Represents the players VR setup. Only one instance at a time is allowed. More...
Public Member Functions | |
void | MoveRigToFeetPosition (Vector3 pos, bool affectMotion=true) |
Instantly moves the PlayerRig so that the players feet (anchor) end up at world coordinates 'pos' More... | |
void | MoveRigToPosition (Vector3 pos, bool affectMotion=true) |
Instantly moves the PlayerRig to a given location More... | |
void | MoveRigToCameraPosition (Vector3 pos, bool affectMotion=true) |
Instantly moves the PlayerRig so that the camera ends up at world coordinates 'pos' More... | |
bool | isCrouching () |
Returns true if the player is crouching / crawling. Uses the "/settings/calibration/player_height" setting to determine this. More... | |
bool | isLeaningForwards () |
Returns true if the player is leaning forwards / bowing. More... | |
float | isLeaningForwardsConfidence () |
Returns a confidence value of how much the player is leaning forwards / bowing. More... | |
Public Member Functions inherited from AVR.Core.AVR_SingletonComponent< T > | |
virtual void | OnApplicationQuit () |
Public Member Functions inherited from AVR.Core.AVR_Behaviour | |
virtual void | OnDestroy () |
Public Attributes | |
Camera | MainCamera |
Camera that represents the HMD More... | |
AVR_Controller | leftHandController => AVR_Controller.leftHandController |
Returns the AVR_Controller that represents the left hand controller (if it exists). This value depends on the controllerNode value and is not updated if this one is changed during runtime. More... | |
AVR_Controller | rightHandController => AVR_Controller.rightHandController |
Returns the AVR_Controller that represents the right hand controller (if it exists). This value depends on the controllerNode value and is not updated if this one is changed during runtime. More... | |
Public Attributes inherited from AVR.Core.AVR_Component | |
UnityEngine.Events.UnityEvent | onAwake |
Events called when this component awakes. More... | |
UnityEngine.Events.UnityEvent | onStart |
Events called when this component starts. More... | |
UnityEngine.Events.UnityEvent | onEnable |
Events called when this component is enabled. More... | |
UnityEngine.Events.UnityEvent | onDisable |
Events called when this component is disabled. More... | |
Protected Member Functions | |
override void | Start () |
void | LateUpdate () |
void | Update () |
Protected Member Functions inherited from AVR.Core.AVR_SingletonComponent< T > | |
override void | Awake () |
Protected Member Functions inherited from AVR.Core.AVR_Component | |
virtual void | OnEnable () |
virtual void | OnDisable () |
Properties | |
Vector3 | AvgMotion [get] |
Average motion of the players feet over the last 0.5s. More... | |
CharacterController | characterController [get] |
CharacterController represeting the player. Null if no charactercontroller is present. More... | |
Vector3 | RigInWorldSpace [get] |
Player Rig location in world space More... | |
Quaternion | RigRotationInWorldSpace [get] |
Player rig rotation in world space More... | |
Vector3 | CameraInWorldSpace [get] |
Player camera in world space More... | |
Quaternion | CameraRotationInWorldSpace [get] |
Camera rotation in world space More... | |
Vector3 | LocalViewVector [get] |
View-vector in local coordinates relative to the camera More... | |
Vector3 | ViewVector [get] |
View-vector in world space More... | |
Vector3 | ViewPos [get] |
Position of the cameras view-vector tip in world space More... | |
Vector3 | XZPlaneFacingDirection [get] |
Returns a vector in the XZ plane that corresponds to the direction the player is facing with his body. This is NOT equivalent with the facing direction of the camera. (For instance when the player bows or leans backward.) More... | |
Vector3 | CameraInRigSpace [get] |
Player camera in local space (relative to the AVR_PlayerRig object) More... | |
float | CameraHeightInRigSpace [get] |
Height of the camera in local space. Equivalent to the distance between HMD from the gorund. More... | |
Vector3 | FeetInWorldSpace [get] |
Position on the gorund directly underneath the camera. (World space) More... | |
Vector3 | FeetInRigSpace [get] |
Position on the gorund directly underneath the camera. (local space, relative to AVR_PlayerRig object) More... | |
Properties inherited from AVR.Core.AVR_SingletonComponent< T > | |
static T | Instance [get, set] |
Private Attributes | |
Vector3 | _RigPosInWorldSpace |
Quaternion | _RigRotInWorldSpace |
Vector3 | _CameraPosInWorldSpace |
Quaternion | _CameraRotInWorldSpace |
Vector3 | _motion = Vector3.zero |
Vector3 | _lastFPos |
CharacterController | _characterController |
Additional Inherited Members | |
Protected Attributes inherited from AVR.Core.AVR_Behaviour | |
AVR_PlayerRig | playerRig => AVR_PlayerRig.Instance |
The current AVR_PlayerRig instance in the scene More... | |
AVR_Root | root => AVR_Root.Instance |
The current AVR_Root instance in the scene More... | |
bool | vrEnabled => UnityEngine.XR.XRSettings.enabled |
True if the application is running as a VR/XR application More... | |
Represents the players VR setup. Only one instance at a time is allowed.
Definition at line 14 of file AVR_PlayerRig.cs.