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

Public Member Functions

 Camera3D ()
 
 Camera3D (::Vector3 positionValue, ::Vector3 targetValue, ::Vector3 upValue, float fovyValue=0, int typeValue=0)
 
 Camera3D (const ::Camera3D &camera)
 
Camera3D & BeginMode ()
 Initializes 3D mode with custom camera (3D) More...
 
Camera3D & DrawBillboard (const ::Texture2D &texture, ::Rectangle sourceRec, ::Vector3 center, float size, ::Color tint={255, 255, 255, 255})
 Draw a billboard texture defined by source. More...
 
Camera3D & DrawBillboard (const ::Texture2D &texture, ::Vector3 center, float size, ::Color tint={255, 255, 255, 255})
 Draw a billboard texture. More...
 
Camera3D & EndMode ()
 Ends 3D mode and returns to default 2D orthographic mode. More...
 
float GetFovy () const
 
Matrix GetMatrix () const
 Get transform matrix for camera. More...
 
Ray GetMouseRay (::Vector2 mousePosition) const
 Returns a ray trace from mouse position. More...
 
inline ::Vector3 GetPosition () const
 
inline ::Vector3 GetTarget () const
 
int GetType () const
 
inline ::Vector3 GetUp () const
 
Vector2 GetWorldToScreen (::Vector3 position) const
 Returns the screen space position for a 3d world space position. More...
 
Camera3D & operator= (const ::Camera3D &camera)
 
Camera3D & SetAltControl (int altKey)
 Set camera alt key to combine with mouse movement (free camera) More...
 
void SetFovy (float value)
 
Camera3D & SetMode (int mode)
 Set camera mode (multiple camera modes available) More...
 
Camera3D & SetMoveControls (int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey)
 Set camera move controls (1st person and 3rd person cameras) More...
 
void SetPosition (::Vector3 value)
 
Camera3D & SetSmoothZoomControl (int szKey)
 Set camera smooth zoom key to combine with mouse (free camera) More...
 
void SetTarget (::Vector3 value)
 
void SetType (int value)
 
void SetUp (::Vector3 value)
 
Camera3D & Update ()
 Update camera position for selected mode. More...
 
Camera3D & UpdateVrTracking ()
 Update VR tracking (position and orientation) and camera. More...
 

Protected Member Functions

void set (const ::Camera3D &camera)
 

Detailed Description

Definition at line 33 of file Camera3D.hpp.

Constructor & Destructor Documentation

◆ Camera3D() [1/3]

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

Definition at line 35 of file Camera3D.hpp.

References set().

◆ Camera3D() [2/3]

raylib::Camera3D::Camera3D ( ::Vector3  positionValue,
::Vector3  targetValue,
::Vector3  upValue,
float  fovyValue = 0,
int  typeValue = 0 
)
inline

Definition at line 39 of file Camera3D.hpp.

◆ Camera3D() [3/3]

raylib::Camera3D::Camera3D ( )
inline

Definition at line 48 of file Camera3D.hpp.

Member Function Documentation

◆ BeginMode()

Camera3D& raylib::Camera3D::BeginMode ( )
inline

Initializes 3D mode with custom camera (3D)

Definition at line 64 of file Camera3D.hpp.

◆ DrawBillboard() [1/2]

Camera3D& raylib::Camera3D::DrawBillboard ( const ::Texture2D &  texture,
::Rectangle  sourceRec,
::Vector3  center,
float  size,
::Color  tint = {255, 255, 255, 255} 
)
inline

Draw a billboard texture defined by source.

Definition at line 164 of file Camera3D.hpp.

◆ DrawBillboard() [2/2]

Camera3D& raylib::Camera3D::DrawBillboard ( const ::Texture2D &  texture,
::Vector3  center,
float  size,
::Color  tint = {255, 255, 255, 255} 
)
inline

Draw a billboard texture.

Definition at line 152 of file Camera3D.hpp.

◆ EndMode()

Camera3D& raylib::Camera3D::EndMode ( )
inline

Ends 3D mode and returns to default 2D orthographic mode.

Definition at line 72 of file Camera3D.hpp.

◆ GetFovy()

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

Definition at line 53 of file Camera3D.hpp.

◆ GetMatrix()

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

Get transform matrix for camera.

Definition at line 80 of file Camera3D.hpp.

◆ GetMouseRay()

Ray raylib::Camera3D::GetMouseRay ( ::Vector2  mousePosition) const
inline

Returns a ray trace from mouse position.

Definition at line 138 of file Camera3D.hpp.

◆ GetPosition()

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

Definition at line 50 of file Camera3D.hpp.

◆ GetTarget()

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

Definition at line 51 of file Camera3D.hpp.

◆ GetType()

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

Definition at line 54 of file Camera3D.hpp.

◆ GetUp()

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

Definition at line 52 of file Camera3D.hpp.

◆ GetWorldToScreen()

Vector2 raylib::Camera3D::GetWorldToScreen ( ::Vector3  position) const
inline

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

Definition at line 145 of file Camera3D.hpp.

◆ operator=()

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

Definition at line 56 of file Camera3D.hpp.

References set().

◆ set()

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

Definition at line 175 of file Camera3D.hpp.

Referenced by Camera3D(), and operator=().

◆ SetAltControl()

Camera3D& raylib::Camera3D::SetAltControl ( int  altKey)
inline

Set camera alt key to combine with mouse movement (free camera)

Definition at line 95 of file Camera3D.hpp.

◆ SetFovy()

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

Definition at line 53 of file Camera3D.hpp.

◆ SetMode()

Camera3D& raylib::Camera3D::SetMode ( int  mode)
inline

Set camera mode (multiple camera modes available)

Definition at line 87 of file Camera3D.hpp.

◆ SetMoveControls()

Camera3D& raylib::Camera3D::SetMoveControls ( int  frontKey,
int  backKey,
int  rightKey,
int  leftKey,
int  upKey,
int  downKey 
)
inline

Set camera move controls (1st person and 3rd person cameras)

Definition at line 111 of file Camera3D.hpp.

◆ SetPosition()

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

Definition at line 50 of file Camera3D.hpp.

◆ SetSmoothZoomControl()

Camera3D& raylib::Camera3D::SetSmoothZoomControl ( int  szKey)
inline

Set camera smooth zoom key to combine with mouse (free camera)

Definition at line 103 of file Camera3D.hpp.

◆ SetTarget()

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

Definition at line 51 of file Camera3D.hpp.

◆ SetType()

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

Definition at line 54 of file Camera3D.hpp.

◆ SetUp()

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

Definition at line 52 of file Camera3D.hpp.

◆ Update()

Camera3D& raylib::Camera3D::Update ( )
inline

Update camera position for selected mode.

Definition at line 122 of file Camera3D.hpp.

References raylib::UpdateCamera().

◆ UpdateVrTracking()

Camera3D& raylib::Camera3D::UpdateVrTracking ( )
inline

Update VR tracking (position and orientation) and camera.

Definition at line 130 of file Camera3D.hpp.