 |
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)
81 return ::GetCameraMatrix(*
this);
88 ::SetCameraMode(*
this, mode);
96 ::SetCameraAltControl(altKey);
104 ::SetCameraSmoothZoomControl(szKey);
112 int frontKey,
int backKey,
113 int rightKey,
int leftKey,
114 int upKey,
int downKey) {
115 ::SetCameraMoveControls(frontKey, backKey, rightKey, leftKey, upKey, downKey);
139 return ::GetMouseRay(mousePosition, *
this);
146 return ::GetWorldToScreen(position, *
this);
153 const ::Texture2D& texture,
156 ::
Color tint = {255, 255, 255, 255}) {
165 const ::Texture2D& texture,
169 ::
Color tint = {255, 255, 255, 255}) {
170 ::DrawBillboardRec(*
this, texture, sourceRec, center, size, tint);
175 inline void set(const ::Camera3D& camera) {
176 position = camera.position;
177 target = camera.target;
187 #endif // RAYLIB_CPP_INCLUDE_CAMERA3D_HPP_
Provides all the classes associated with raylib-cpp.
static void UpdateCamera(const ::Camera &camera)
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})
Draw a billboard texture.
Camera3D(::Vector3 positionValue, ::Vector3 targetValue, ::Vector3 upValue, float fovyValue=0, int typeValue=0)
Camera3D(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})
Draw a billboard texture defined by source.
Camera3D & SetSmoothZoomControl(int szKey)
Set camera smooth zoom key to combine with mouse (free camera)
Vector2 GetWorldToScreen(::Vector3 position) const
Returns the screen space position for a 3d world space position.