ARVRServerCenterOnHmd Method |
This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently.
For platforms that do not offer spatial tracking, our origin point (0,0,0) is the location of our HMD, but you have little control over the direction the player is facing in the real world.
For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera.
This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world.
For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game.
You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism.
Namespace: Godot
public static void CenterOnHmd( ARVRServerRotationMode rotationMode, bool keepHeight )
[Missing <param name="rotationMode"/> documentation for "M:Godot.ARVRServer.CenterOnHmd(Godot.ARVRServer.RotationMode,System.Boolean)"]
[Missing <param name="keepHeight"/> documentation for "M:Godot.ARVRServer.CenterOnHmd(Godot.ARVRServer.RotationMode,System.Boolean)"]