diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-12-23 00:59:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-23 00:59:09 +0100 |
commit | 7d9b7f9c47a7de5416986a1d989040144253a5fe (patch) | |
tree | 96ae120588c2357378e518f901a08b90e4891d6e /servers/arvr_server.h | |
parent | cadad4848205f60fca9dd0849bc16680c5ef8881 (diff) | |
parent | 6fd51b6a1b1467937126334f9ffd7be3d3efbad0 (diff) |
Merge pull request #14897 from BastiaanOlij/arvr_tweaks
Few small tweaks for ARVR
Diffstat (limited to 'servers/arvr_server.h')
-rw-r--r-- | servers/arvr_server.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/servers/arvr_server.h b/servers/arvr_server.h index 9b84ee2e99..0381e6e533 100644 --- a/servers/arvr_server.h +++ b/servers/arvr_server.h @@ -68,6 +68,12 @@ public: TRACKER_ANY = 0xff /* used by get_connected_trackers to return all types */ }; + enum RotationMode { + RESET_FULL_ROTATION = 0, /* we reset the full rotation, regardless of how the HMD is oriented, we're looking dead ahead */ + RESET_BUT_KEEP_TILT = 1, /* reset rotation but keep tilt. */ + DONT_RESET_ROTATION = 2, /* don't reset the rotation, we will only center on position */ + }; + private: Vector<Ref<ARVRInterface> > interfaces; Vector<ARVRPositionalTracker *> trackers; @@ -78,8 +84,6 @@ private: Transform world_origin; /* our world origin point, maps a location in our virtual world to the origin point in our real world tracking volume */ Transform reference_frame; /* our reference frame */ - bool is_tracker_id_in_use_for_type(TrackerType p_tracker_type, int p_tracker_id) const; - protected: static ARVRServer *singleton; @@ -127,7 +131,7 @@ public: and in the virtual world out of sync */ Transform get_reference_frame() const; - void center_on_hmd(bool p_ignore_tilt, bool p_keep_height); + void center_on_hmd(RotationMode p_rotation_mode, bool p_keep_height); /* Interfaces are objects that 'glue' Godot to an AR or VR SDK such as the Oculus SDK, OpenVR, OpenHMD, etc. @@ -150,9 +154,8 @@ public: /* Our trackers are objects that expose the orientation and position of physical devices such as controller, anchor points, etc. They are created and managed by our active AR/VR interfaces. - - Note that for trackers that */ + bool is_tracker_id_in_use_for_type(TrackerType p_tracker_type, int p_tracker_id) const; int get_free_tracker_id_for_type(TrackerType p_tracker_type); void add_tracker(ARVRPositionalTracker *p_tracker); void remove_tracker(ARVRPositionalTracker *p_tracker); @@ -167,5 +170,6 @@ public: #define ARVR ARVRServer VARIANT_ENUM_CAST(ARVRServer::TrackerType); +VARIANT_ENUM_CAST(ARVRServer::RotationMode); #endif |