1#ifndef RAYLIB_CPP_INCLUDE_CAMERA3D_HPP_
2#define RAYLIB_CPP_INCLUDE_CAMERA3D_HPP_
5#include "./Vector2.hpp"
6#include "./Vector3.hpp"
9#include "./raylib-cpp-utils.hpp"
31 ::Vector3 target = ::Vector3{0.0f, 0.0f, 0.0f},
32 ::Vector3 up = ::Vector3{0.0f, 1.0f, 0.0f},
34 int projection = CAMERA_PERSPECTIVE) : ::Camera3D{position, target, up, fovy, projection} {}
38 GETTERSETTER(::Vector3, Position, position)
41 GETTERSETTER(
float, Fovy, fovy)
42 GETTERSETTER(
int, Projection, projection)
69 return ::GetCameraMatrix(*
this);
76 ::UpdateCamera(
this, mode);
84 Camera3D&
Update(::Vector3 movement, ::Vector3 rotation,
float zoom = 1.0f) {
85 ::UpdateCameraPro(
this, movement, rotation, zoom);
93 return ::GetMouseRay(mousePosition, *
this);
100 return ::GetWorldToScreen(position, *
this);
107 const ::Texture2D& texture,
110 ::Color tint = {255, 255, 255, 255})
const {
118 const ::Texture2D& texture,
119 ::Rectangle sourceRec,
122 ::Color tint = {255, 255, 255, 255})
const {
123 ::DrawBillboardRec(*
this, texture, sourceRec, center, size, tint);
127 void set(const ::Camera3D& camera) {
128 position = camera.position;
129 target = camera.target;
132 projection = camera.projection;
136using Camera = Camera3D;
Camera type, defines a camera position/orientation in 3d space.
Matrix GetMatrix() const
Get camera transform matrix (view matrix)
Camera3D & BeginMode()
Initializes 3D mode with custom camera (3D)
Camera3D & EndMode()
Ends 3D mode and returns to default 2D orthographic mode.
Vector2 GetWorldToScreen(::Vector3 position) const
Returns the screen space position for a 3d world space position.
void DrawBillboard(const ::Texture2D &texture, ::Vector3 center, float size, ::Color tint={255, 255, 255, 255}) const
Draw a billboard texture.
Camera3D & Update(int mode)
Update camera position for selected mode.
Camera3D & Update(::Vector3 movement, ::Vector3 rotation, float zoom=1.0f)
Update camera movement/rotation.
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.
Ray GetMouseRay(::Vector2 mousePosition) const
Returns a ray trace from mouse position.
void DrawBillboard(const ::Texture2D &texture, ::Rectangle sourceRec, ::Vector3 center, ::Vector2 size, ::Color tint={255, 255, 255, 255}) const
Draw a billboard texture defined by source.
Matrix type (OpenGL style 4x4 - right handed, column major)
Ray type (useful for raycast)