diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-09 21:01:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-09 21:01:29 +0200 |
commit | dc20830348f2c6ed521c2303765b4ea6ea317288 (patch) | |
tree | 0deffb28f06263157174b7c294209f1ff0e18b99 /scene/3d/camera_3d.h | |
parent | 511f9619736f47946f3d0613bc2642cf2b47beac (diff) | |
parent | 7cec3c2b95cef1274ffcc7f4e044ae86fb965f00 (diff) |
Merge pull request #45568 from aaronfranke/node3d-real_t
Use real_t in 3D nodes
Diffstat (limited to 'scene/3d/camera_3d.h')
-rw-r--r-- | scene/3d/camera_3d.h | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/scene/3d/camera_3d.h b/scene/3d/camera_3d.h index c6efc8f9a9..61e3f51d0b 100644 --- a/scene/3d/camera_3d.h +++ b/scene/3d/camera_3d.h @@ -63,13 +63,13 @@ private: Projection mode = PROJECTION_PERSPECTIVE; - float fov = 0.0; - float size = 1.0; + real_t fov = 0.0; + real_t size = 1.0; Vector2 frustum_offset; - float near = 0.0; - float far = 0.0; - float v_offset = 0.0; - float h_offset = 0.0; + real_t near = 0.0; + real_t far = 0.0; + real_t v_offset = 0.0; + real_t h_offset = 0.0; KeepAspect keep_aspect = KEEP_HEIGHT; RID camera; @@ -107,10 +107,9 @@ public: NOTIFICATION_LOST_CURRENT = 51 }; - 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_z_near, - float p_z_far); + void set_perspective(real_t p_fovy_degrees, real_t p_z_near, real_t p_z_far); + void set_orthogonal(real_t p_size, real_t p_z_near, real_t p_z_far); + void set_frustum(real_t p_size, Vector2 p_offset, real_t p_z_near, real_t p_z_far); void set_projection(Camera3D::Projection p_mode); void make_current(); @@ -120,18 +119,18 @@ public: RID get_camera() const; - float get_fov() const; - float get_size() const; - float get_far() const; - float get_near() const; + real_t get_fov() const; + real_t get_size() const; + real_t get_far() const; + real_t get_near() const; Vector2 get_frustum_offset() const; Projection get_projection() const; - void set_fov(float p_fov); - void set_size(float p_size); - void set_far(float p_far); - void set_near(float p_near); + void set_fov(real_t p_fov); + void set_size(real_t p_size); + void set_far(real_t p_far); + void set_near(real_t p_near); void set_frustum_offset(Vector2 p_offset); virtual Transform3D get_camera_transform() const; @@ -141,8 +140,7 @@ public: virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const; virtual Point2 unproject_position(const Vector3 &p_pos) const; bool is_position_behind(const Vector3 &p_pos) const; - virtual Vector3 project_position(const Point2 &p_point, - float p_z_depth) const; + virtual Vector3 project_position(const Point2 &p_point, real_t p_z_depth) const; Vector<Vector3> get_near_plane_points() const; @@ -164,11 +162,11 @@ public: void set_keep_aspect_mode(KeepAspect p_aspect); KeepAspect get_keep_aspect_mode() const; - void set_v_offset(float p_offset); - float get_v_offset() const; + void set_v_offset(real_t p_offset); + real_t get_v_offset() const; - void set_h_offset(float p_offset); - float get_h_offset() const; + void set_h_offset(real_t p_offset); + real_t get_h_offset() const; void set_doppler_tracking(DopplerTracking p_tracking); DopplerTracking get_doppler_tracking() const; @@ -195,8 +193,8 @@ public: private: ClipProcessCallback process_callback = CLIP_PROCESS_PHYSICS; RID pyramid_shape; - float margin = 0.0; - float clip_offset = 0.0; + real_t margin = 0.0; + real_t clip_offset = 0.0; uint32_t collision_mask = 1; bool clip_to_areas = false; bool clip_to_bodies = true; @@ -217,8 +215,8 @@ public: void set_clip_to_bodies(bool p_clip); bool is_clip_to_bodies_enabled() const; - void set_margin(float p_margin); - float get_margin() const; + void set_margin(real_t p_margin); + real_t get_margin() const; void set_process_callback(ClipProcessCallback p_mode); ClipProcessCallback get_process_callback() const; @@ -235,7 +233,7 @@ public: void remove_exception(const Object *p_object); void clear_exceptions(); - float get_clip_offset() const; + real_t get_clip_offset() const; ClippedCamera3D(); ~ClippedCamera3D(); |