raylib-cpp
C++ object-oriented wrapper library for raylib.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
raylib::Camera2D Class Reference

Camera2D type, defines a 2d camera. More...

#include <Camera2D.hpp>

Public Member Functions

 Camera2D (::Vector2 offset, ::Vector2 target, Degree rotation=0.0f, float zoom=1.0f)
 
 Camera2D (const ::Camera2D &camera)
 
Camera2DBeginMode ()
 
Camera2DEndMode ()
 
Matrix GetMatrix () const
 Returns camera 2d transform matrix. More...
 
::Vector2 GetOffset () const
 Retrieves the offset value for the object. More...
 
Degree GetRotation () const
 Retrieves the rotation value for the object. More...
 
Vector2 GetScreenToWorld (::Vector2 position) const
 Returns the world space position for a 2d camera screen space position. More...
 
::Vector2 GetTarget () const
 Retrieves the target value for the object. More...
 
Vector2 GetWorldToScreen (::Vector2 position) const
 Returns the screen space position for a 3d world space position. More...
 
float GetZoom () const
 Retrieves the zoom value for the object. More...
 
Camera2Doperator= (const ::Camera2D &camera)
 
void SetOffset (::Vector2 value)
 Sets the offset value for the object. More...
 
void SetRotation (Degree value)
 Sets the rotation value for the object. More...
 
void SetTarget (::Vector2 value)
 Sets the target value for the object. More...
 
void SetZoom (float value)
 Sets the zoom value for the object. More...
 

Protected Member Functions

void set (const ::Camera2D &camera)
 

Detailed Description

Camera2D type, defines a 2d camera.

Definition at line 14 of file Camera2D.hpp.

Constructor & Destructor Documentation

◆ Camera2D() [1/3]

raylib::Camera2D::Camera2D ( const ::Camera2D &  camera)
inline

Definition at line 16 of file Camera2D.hpp.

◆ Camera2D() [2/3]

raylib::Camera2D::Camera2D ( )
inline

Definition at line 20 of file Camera2D.hpp.

◆ Camera2D() [3/3]

raylib::Camera2D::Camera2D ( ::Vector2  offset,
::Vector2  target,
Degree  rotation = 0.0f,
float  zoom = 1.0f 
)
inline

Definition at line 21 of file Camera2D.hpp.

Member Function Documentation

◆ BeginMode()

Camera2D & raylib::Camera2D::BeginMode ( )
inline

Definition at line 24 of file Camera2D.hpp.

◆ EndMode()

Camera2D & raylib::Camera2D::EndMode ( )
inline

Definition at line 29 of file Camera2D.hpp.

◆ GetMatrix()

Matrix raylib::Camera2D::GetMatrix ( ) const
inline

Returns camera 2d transform matrix.

Definition at line 47 of file Camera2D.hpp.

◆ GetOffset()

::Vector2 raylib::Camera2D::GetOffset ( ) const
inline

Retrieves the offset value for the object.

Returns
The offset value of the object.

Definition at line 34 of file Camera2D.hpp.

◆ GetRotation()

Degree raylib::Camera2D::GetRotation ( ) const
inline

Retrieves the rotation value for the object.

Returns
The rotation value of the object.

Definition at line 36 of file Camera2D.hpp.

◆ GetScreenToWorld()

Vector2 raylib::Camera2D::GetScreenToWorld ( ::Vector2  position) const
inline

Returns the world space position for a 2d camera screen space position.

Definition at line 54 of file Camera2D.hpp.

◆ GetTarget()

::Vector2 raylib::Camera2D::GetTarget ( ) const
inline

Retrieves the target value for the object.

Returns
The target value of the object.

Definition at line 35 of file Camera2D.hpp.

◆ GetWorldToScreen()

Vector2 raylib::Camera2D::GetWorldToScreen ( ::Vector2  position) const
inline

Returns the screen space position for a 3d world space position.

Definition at line 61 of file Camera2D.hpp.

◆ GetZoom()

float raylib::Camera2D::GetZoom ( ) const
inline

Retrieves the zoom value for the object.

Returns
The zoom value of the object.

Definition at line 37 of file Camera2D.hpp.

◆ operator=()

Camera2D & raylib::Camera2D::operator= ( const ::Camera2D &  camera)
inline

Definition at line 39 of file Camera2D.hpp.

◆ set()

void raylib::Camera2D::set ( const ::Camera2D &  camera)
inlineprotected

Definition at line 66 of file Camera2D.hpp.

◆ SetOffset()

void raylib::Camera2D::SetOffset ( ::Vector2  value)
inline

Sets the offset value for the object.

Parameters
valueThe value of which to set offset to.

Definition at line 34 of file Camera2D.hpp.

◆ SetRotation()

void raylib::Camera2D::SetRotation ( Degree  value)
inline

Sets the rotation value for the object.

Parameters
valueThe value of which to set rotation to.

Definition at line 36 of file Camera2D.hpp.

◆ SetTarget()

void raylib::Camera2D::SetTarget ( ::Vector2  value)
inline

Sets the target value for the object.

Parameters
valueThe value of which to set target to.

Definition at line 35 of file Camera2D.hpp.

◆ SetZoom()

void raylib::Camera2D::SetZoom ( float  value)
inline

Sets the zoom value for the object.

Parameters
valueThe value of which to set zoom to.

Definition at line 37 of file Camera2D.hpp.