diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-03 13:34:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-03 13:34:14 +0200 |
commit | c51354f504a7892483fdce721d720aada4c53671 (patch) | |
tree | 14bc6ebac9bcc60beaa6e86efca40e093a7216b5 /scene/3d/arvr_nodes.h | |
parent | 0257ced05bf85fdd727f4c68a6ddf4c5c1876694 (diff) | |
parent | e7aed24adde416bc0fad058ee35b9ce3dfe00c10 (diff) |
Merge pull request #10062 from BastiaanOlij/arvr_add_anchor
Added ARVRAnchor support and a few small enhancements
Diffstat (limited to 'scene/3d/arvr_nodes.h')
-rw-r--r-- | scene/3d/arvr_nodes.h | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h index 3dab263317..936519126b 100644 --- a/scene/3d/arvr_nodes.h +++ b/scene/3d/arvr_nodes.h @@ -39,7 +39,7 @@ **/ /* - ARVRCamera is a subclass of camera which will register itself with its parent ARVROrigin and as a result is automatically positioned + ARVRCamera is a subclass of camera which will register itself with its parent ARVROrigin and as a result is automatically positioned */ class ARVRCamera : public Camera { @@ -56,9 +56,9 @@ public: }; /* - ARVRController is a helper node that automatically updates it's position based on tracker data. + ARVRController is a helper node that automatically updates it's position based on tracker data. - It must be a child node of our ARVROrigin node + It must be a child node of our ARVROrigin node */ class ARVRController : public Spatial { @@ -92,6 +92,37 @@ public: }; /* + ARVRAnchor is a helper node that automatically updates it's position based on anchor data, it represents a real world location. + It must be a child node of our ARVROrigin node +*/ + +class ARVRAnchor : public Spatial { + GDCLASS(ARVRAnchor, Spatial); + +private: + int anchor_id; + bool is_active; + Vector3 size; + +protected: + void _notification(int p_what); + static void _bind_methods(); + +public: + void set_anchor_id(int p_anchor_id); + int get_anchor_id(void) const; + String get_anchor_name(void) const; + + bool get_is_active() const; + Vector3 get_size() const; + + String get_configuration_warning() const; + + ARVRAnchor(); + ~ARVRAnchor(); +}; + +/* ARVROrigin is special spatial node that acts as our origin point mapping our real world center of our tracking volume into our virtual world. It is this point that you will move around the world as the player 'moves while standing still', i.e. the player moves through teleporting or controller inputs as opposed to physically moving. |