summaryrefslogtreecommitdiff
path: root/scene/3d/camera.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/camera.h')
-rw-r--r--scene/3d/camera.h46
1 files changed, 19 insertions, 27 deletions
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index 5301c06ee5..3c31b6beeb 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -29,7 +29,6 @@
#ifndef CAMERA_H
#define CAMERA_H
-
#include "scene/3d/spatial.h"
#include "scene/main/viewport.h"
#include "scene/resources/environment.h"
@@ -38,7 +37,8 @@
*/
class Camera : public Spatial {
- GDCLASS( Camera, Spatial );
+ GDCLASS(Camera, Spatial);
+
public:
enum Projection {
@@ -52,7 +52,6 @@ public:
};
private:
-
bool force_change;
bool current;
@@ -60,7 +59,7 @@ private:
float fov;
float size;
- float near,far;
+ float near, far;
float v_offset;
float h_offset;
KeepAspect keep_aspect;
@@ -76,30 +75,27 @@ private:
virtual bool _can_gizmo_scale() const;
-
-
//void _camera_make_current(Node *p_camera);
-friend class Viewport;
+ friend class Viewport;
void _update_audio_listener_state();
-protected:
+protected:
void _update_camera();
virtual void _request_camera_update();
void _update_camera_mode();
- bool _set(const StringName& p_name, const Variant& p_value);
- bool _get(const StringName& p_name,Variant &r_ret) const;
- void _get_property_list( List<PropertyInfo> *p_list) const;
+ bool _set(const StringName &p_name, const Variant &p_value);
+ bool _get(const StringName &p_name, Variant &r_ret) const;
+ void _get_property_list(List<PropertyInfo> *p_list) const;
void _notification(int p_what);
static void _bind_methods();
public:
-
enum {
- NOTIFICATION_BECAME_CURRENT=50,
- NOTIFICATION_LOST_CURRENT=51
+ NOTIFICATION_BECAME_CURRENT = 50,
+ NOTIFICATION_LOST_CURRENT = 51
};
void set_perspective(float p_fovy_degrees, float p_z_near, float p_z_far);
@@ -119,39 +115,35 @@ public:
virtual Transform get_camera_transform() const;
- Vector3 project_ray_normal(const Point2& p_point) const;
- Vector3 project_ray_origin(const Point2& p_point) const;
- Vector3 project_local_ray_normal(const Point2& p_point) const;
- Point2 unproject_position(const Vector3& p_pos) const;
- bool is_position_behind(const Vector3& p_pos) const;
- Vector3 project_position(const Point2& p_point) const;
+ Vector3 project_ray_normal(const Point2 &p_point) const;
+ Vector3 project_ray_origin(const Point2 &p_point) const;
+ Vector3 project_local_ray_normal(const Point2 &p_point) const;
+ Point2 unproject_position(const Vector3 &p_pos) const;
+ bool is_position_behind(const Vector3 &p_pos) const;
+ Vector3 project_position(const Point2 &p_point) const;
void set_cull_mask(uint32_t p_layers);
uint32_t get_cull_mask() const;
Vector<Plane> get_frustum() const;
- void set_environment(const Ref<Environment>& p_environment);
+ void set_environment(const Ref<Environment> &p_environment);
Ref<Environment> get_environment() const;
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_h_offset(float p_offset);
float get_h_offset() const;
-
Camera();
~Camera();
-
};
-
-VARIANT_ENUM_CAST( Camera::Projection );
-VARIANT_ENUM_CAST( Camera::KeepAspect );
+VARIANT_ENUM_CAST(Camera::Projection);
+VARIANT_ENUM_CAST(Camera::KeepAspect);
#endif