 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
25 #ifndef RAYLIB_CPP_INCLUDE_CAMERA3D_HPP_
26 #define RAYLIB_CPP_INCLUDE_CAMERA3D_HPP_
28 #include "./raylib.hpp"
29 #include "./Vector3.hpp"
30 #include "./raylib-cpp-utils.hpp"
40 float fovyValue = 0,
int typeValue = 0) {
41 position = positionValue;
50 GETTERSETTER(::
Vector3, Position, position)
53 GETTERSETTER(
float, Fovy, fovy)
54 GETTERSETTER(
int, Type, type)
86 return ::GetCameraMatrix(*
this);
93 ::SetCameraMode(*
this, mode);
101 ::SetCameraAltControl(altKey);
109 ::SetCameraSmoothZoomControl(szKey);
117 int frontKey,
int backKey,
118 int rightKey,
int leftKey,
119 int upKey,
int downKey) {
120 ::SetCameraMoveControls(frontKey, backKey, rightKey, leftKey, upKey, downKey);
128 ::UpdateCamera(
this);
144 return ::GetMouseRay(mousePosition, *
this);
151 return ::GetWorldToScreen(position, *
this);
155 const ::Texture2D& texture,
158 ::
Color tint = {255, 255, 255, 255}) {
164 const ::Texture2D& texture,
168 ::
Color tint = {255, 255, 255, 255}) {
169 ::DrawBillboardRec(*
this, texture, sourceRec, center, size, tint);
174 inline void set(const ::Camera3D& camera) {
175 position = camera.position;
176 target = camera.target;
183 position = camera.position;
184 target = camera.target;
194 #endif // RAYLIB_CPP_INCLUDE_CAMERA3D_HPP_
Provides all the classes associated with raylib-cpp.
Ray GetMouseRay(::Vector2 mousePosition) const
Returns a ray trace from mouse position.
Camera3D & SetMode(int mode)
Set camera mode (multiple camera modes available)
Matrix GetMatrix() const
Get transform matrix for camera.
Camera3D & BeginMode()
Initializes 3D mode with custom camera (3D)
Camera3D & EndMode()
Ends 3D mode and returns to default 2D orthographic mode.
Ray type (useful for raycast)
Camera3D & UpdateVrTracking()
Update VR tracking (position and orientation) and camera.
Camera3D & Update()
Update camera position for selected mode.
Camera3D & SetMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey)
Set camera move controls (1st person and 3rd person cameras)
Camera3D & SetAltControl(int altKey)
Set camera alt key to combine with mouse movement (free camera)
Camera3D & DrawBillboard(const ::Texture2D &texture, ::Vector3 center, float size, ::Color tint={255, 255, 255, 255})
Camera3D(::Vector3 positionValue, ::Vector3 targetValue, ::Vector3 upValue, float fovyValue=0, int typeValue=0)
Camera3D(const ::Camera3D &camera)
Camera3D & operator=(const Camera3D &camera)
void set(const ::Camera3D &camera)
Camera3D & DrawBillboard(const ::Texture2D &texture, ::Rectangle sourceRec, ::Vector3 center, float size, ::Color tint={255, 255, 255, 255})
Camera3D & SetSmoothZoomControl(int szKey)
Set camera smooth zoom key to combine with mouse (free camera)
void set(const Camera3D &camera)
Vector2 GetWorldToScreen(::Vector3 position) const
Returns the screen space position for a 3d world space position.