summaryrefslogtreecommitdiff
path: root/scene/3d/xr_nodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/xr_nodes.h')
-rw-r--r--scene/3d/xr_nodes.h59
1 files changed, 28 insertions, 31 deletions
diff --git a/scene/3d/xr_nodes.h b/scene/3d/xr_nodes.h
index a2f16545d1..751b2b68cb 100644
--- a/scene/3d/xr_nodes.h
+++ b/scene/3d/xr_nodes.h
@@ -44,22 +44,21 @@
XRCamera is a subclass of camera which will register itself with its parent XROrigin and as a result is automatically positioned
*/
class XRCamera3D : public Camera3D {
-
GDCLASS(XRCamera3D, Camera3D);
protected:
void _notification(int p_what);
public:
- String get_configuration_warning() const;
+ String get_configuration_warning() const override;
- virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const;
- virtual Point2 unproject_position(const Vector3 &p_pos) const;
- virtual Vector3 project_position(const Point2 &p_point, float p_z_depth) const;
- virtual Vector<Plane> get_frustum() const;
+ virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const override;
+ virtual Point2 unproject_position(const Vector3 &p_pos) const override;
+ virtual Vector3 project_position(const Point2 &p_point, float p_z_depth) const override;
+ virtual Vector<Plane> get_frustum() const override;
- XRCamera3D();
- ~XRCamera3D();
+ XRCamera3D() {}
+ ~XRCamera3D() {}
};
/*
@@ -69,13 +68,12 @@ public:
*/
class XRController3D : public Node3D {
-
GDCLASS(XRController3D, Node3D);
private:
- int controller_id;
- bool is_active;
- int button_states;
+ int controller_id = 1;
+ bool is_active = true;
+ int button_states = 0;
Ref<Mesh> mesh;
protected:
@@ -84,8 +82,8 @@ protected:
public:
void set_controller_id(int p_controller_id);
- int get_controller_id(void) const;
- String get_controller_name(void) const;
+ int get_controller_id() const;
+ String get_controller_name() const;
int get_joystick_id() const;
bool is_button_pressed(int p_button) const;
@@ -97,12 +95,12 @@ public:
bool get_is_active() const;
XRPositionalTracker::TrackerHand get_hand() const;
- Ref<Mesh> get_mesh(void) const;
+ Ref<Mesh> get_mesh() const;
- String get_configuration_warning() const;
+ String get_configuration_warning() const override;
- XRController3D();
- ~XRController3D();
+ XRController3D() {}
+ ~XRController3D() {}
};
/*
@@ -114,8 +112,8 @@ class XRAnchor3D : public Node3D {
GDCLASS(XRAnchor3D, Node3D);
private:
- int anchor_id;
- bool is_active;
+ int anchor_id = 1;
+ bool is_active = true;
Vector3 size;
Ref<Mesh> mesh;
@@ -125,20 +123,20 @@ protected:
public:
void set_anchor_id(int p_anchor_id);
- int get_anchor_id(void) const;
- String get_anchor_name(void) const;
+ int get_anchor_id() const;
+ String get_anchor_name() const;
bool get_is_active() const;
Vector3 get_size() const;
Plane get_plane() const;
- Ref<Mesh> get_mesh(void) const;
+ Ref<Mesh> get_mesh() const;
- String get_configuration_warning() const;
+ String get_configuration_warning() const override;
- XRAnchor3D();
- ~XRAnchor3D();
+ XRAnchor3D() {}
+ ~XRAnchor3D() {}
};
/*
@@ -150,18 +148,17 @@ public:
This node will automatically locate any camera child nodes and update its position while our XRController3D node will handle tracked controllers.
*/
class XROrigin3D : public Node3D {
-
GDCLASS(XROrigin3D, Node3D);
private:
- XRCamera3D *tracked_camera;
+ XRCamera3D *tracked_camera = nullptr;
protected:
void _notification(int p_what);
static void _bind_methods();
public:
- String get_configuration_warning() const;
+ String get_configuration_warning() const override;
void set_tracked_camera(XRCamera3D *p_tracked_camera);
void clear_tracked_camera_if(XRCamera3D *p_tracked_camera);
@@ -169,8 +166,8 @@ public:
float get_world_scale() const;
void set_world_scale(float p_world_scale);
- XROrigin3D();
- ~XROrigin3D();
+ XROrigin3D() {}
+ ~XROrigin3D() {}
};
#endif /* XR_NODES_H */