diff options
author | JFonS <joan.fonssanchez@gmail.com> | 2019-02-19 17:17:02 +0100 |
---|---|---|
committer | JFonS <joan.fonssanchez@gmail.com> | 2019-02-19 17:48:08 +0100 |
commit | 54b95b6c5ab476707a5ec3a210266716dfbcd3fe (patch) | |
tree | f35e1343eddde25dd9c3008b3a0de655724a6382 /scene/3d/camera.h | |
parent | c7ba1e210e4148dbb2ab5cb3322a0fc9c4dce2d7 (diff) | |
download | redot-engine-54b95b6c5ab476707a5ec3a210266716dfbcd3fe.tar.gz |
Add FRUSTUM camera mode, allowing tilted frustums
This new camera mode makes it easy to create tilted frustums for mirror
or portal effects.
This work was kindly sponsored by IMVU.
Diffstat (limited to 'scene/3d/camera.h')
-rw-r--r-- | scene/3d/camera.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scene/3d/camera.h b/scene/3d/camera.h index a531324a85..fe8cb84f0d 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -46,7 +46,8 @@ public: enum Projection { PROJECTION_PERSPECTIVE, - PROJECTION_ORTHOGONAL + PROJECTION_ORTHOGONAL, + PROJECTION_FRUSTUM }; enum KeepAspect { @@ -68,6 +69,7 @@ private: float fov; float size; + Vector2 frustum_offset; float near, far; float v_offset; float h_offset; @@ -110,6 +112,7 @@ public: void set_perspective(float p_fovy_degrees, float p_z_near, float p_z_far); void set_orthogonal(float p_size, float p_z_near, float p_z_far); + void set_frustum(float p_size, Vector2 p_offset, float p_near, float p_far); void set_projection(Camera::Projection p_mode); void make_current(); @@ -123,12 +126,15 @@ public: float get_size() const; float get_zfar() const; float get_znear() const; + Vector2 get_frustum_offset() const; + Projection get_projection() const; void set_fov(float p_fov); void set_size(float p_size); void set_zfar(float p_zfar); void set_znear(float p_znear); + void set_frustum_offset(Vector2 p_offset); virtual Transform get_camera_transform() const; |