raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | List of all members
raylib::Camera3D Class Reference

Camera type, defines a camera position/orientation in 3d space. More...

Public Member Functions

 Camera3D (::Vector3 position, ::Vector3 target=::Vector3{0.0f, 0.0f, 0.0f}, ::Vector3 up=::Vector3{0.0f, 1.0f, 0.0f}, float fovy=0, int projection=CAMERA_PERSPECTIVE)
 Create a new Camera3D. More...
 
 Camera3D (const ::Camera3D &camera)
 
Camera3DBeginMode ()
 Initializes 3D mode with custom camera (3D)
 
Camera3DDrawBillboard (const ::Texture2D &texture, ::Rectangle sourceRec, ::Vector3 center, ::Vector2 size, ::Color tint={255, 255, 255, 255})
 Draw a billboard texture defined by source.
 
Camera3DDrawBillboard (const ::Texture2D &texture, ::Vector3 center, float size, ::Color tint={255, 255, 255, 255})
 Draw a billboard texture.
 
Camera3DEndMode ()
 Ends 3D mode and returns to default 2D orthographic mode.
 
float GetFovy () const
 Retrieves the fovy value for the object. More...
 
Matrix GetMatrix () const
 Get transform matrix for camera.
 
Ray GetMouseRay (::Vector2 mousePosition) const
 Returns a ray trace from mouse position.
 
::Vector3 GetPosition () const
 Retrieves the position value for the object. More...
 
int GetProjection () const
 Retrieves the projection value for the object. More...
 
::Vector3 GetTarget () const
 Retrieves the target value for the object. More...
 
::Vector3 GetUp () const
 Retrieves the up value for the object. More...
 
Vector2 GetWorldToScreen (::Vector3 position) const
 Returns the screen space position for a 3d world space position.
 
Camera3Doperator= (const ::Camera3D &camera)
 
Camera3DSetAltControl (int altKey)
 Set camera alt key to combine with mouse movement (free camera)
 
void SetFovy (float value)
 Sets the fovy value for the object. More...
 
Camera3DSetMode (int mode)
 Set camera mode (multiple camera modes available)
 
Camera3DSetMoveControls (int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey)
 Set camera move controls (1st person and 3rd person cameras)
 
void SetPosition (::Vector3 value)
 Sets the position value for the object. More...
 
void SetProjection (int value)
 Sets the projection value for the object. More...
 
Camera3DSetSmoothZoomControl (int szKey)
 Set camera smooth zoom key to combine with mouse (free camera)
 
void SetTarget (::Vector3 value)
 Sets the target value for the object. More...
 
void SetUp (::Vector3 value)
 Sets the up value for the object. More...
 
Camera3DUpdate ()
 Update camera position for selected mode.
 

Detailed Description

Camera type, defines a camera position/orientation in 3d space.

Definition at line 12 of file Camera3D.hpp.

Constructor & Destructor Documentation

◆ Camera3D()

raylib::Camera3D::Camera3D ( ::Vector3  position,
::Vector3  target = ::Vector3{0.0f, 0.0f, 0.0f},
::Vector3  up = ::Vector3{0.0f, 1.0f, 0.0f},
float  fovy = 0,
int  projection = CAMERA_PERSPECTIVE 
)
inline

Create a new Camera3D.

Parameters
positionCamera position
targetCamera target it looks-at
upCamera up vector (rotation over its axis)
fovyCamera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
projectionCamera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC

Definition at line 27 of file Camera3D.hpp.

Member Function Documentation

◆ GetFovy()

float raylib::Camera3D::GetFovy ( ) const
inline

Retrieves the fovy value for the object.

Returns
The fovy value of the object.

Definition at line 38 of file Camera3D.hpp.

◆ GetPosition()

::Vector3 raylib::Camera3D::GetPosition ( ) const
inline

Retrieves the position value for the object.

Returns
The position value of the object.

Definition at line 35 of file Camera3D.hpp.

◆ GetProjection()

int raylib::Camera3D::GetProjection ( ) const
inline

Retrieves the projection value for the object.

Returns
The projection value of the object.

Definition at line 39 of file Camera3D.hpp.

◆ GetTarget()

::Vector3 raylib::Camera3D::GetTarget ( ) const
inline

Retrieves the target value for the object.

Returns
The target value of the object.

Definition at line 36 of file Camera3D.hpp.

◆ GetUp()

::Vector3 raylib::Camera3D::GetUp ( ) const
inline

Retrieves the up value for the object.

Returns
The up value of the object.

Definition at line 37 of file Camera3D.hpp.

◆ SetFovy()

void raylib::Camera3D::SetFovy ( float  value)
inline

Sets the fovy value for the object.

Parameters
valueThe value of which to set fovy to.

Definition at line 38 of file Camera3D.hpp.

◆ SetPosition()

void raylib::Camera3D::SetPosition ( ::Vector3  value)
inline

Sets the position value for the object.

Parameters
valueThe value of which to set position to.

Definition at line 35 of file Camera3D.hpp.

◆ SetProjection()

void raylib::Camera3D::SetProjection ( int  value)
inline

Sets the projection value for the object.

Parameters
valueThe value of which to set projection to.

Definition at line 39 of file Camera3D.hpp.

◆ SetTarget()

void raylib::Camera3D::SetTarget ( ::Vector3  value)
inline

Sets the target value for the object.

Parameters
valueThe value of which to set target to.

Definition at line 36 of file Camera3D.hpp.

◆ SetUp()

void raylib::Camera3D::SetUp ( ::Vector3  value)
inline

Sets the up value for the object.

Parameters
valueThe value of which to set up to.

Definition at line 37 of file Camera3D.hpp.