VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
bool AVR.Core.AVR_PlayerRig.isCrouching ( )
inline

Returns true if the player is crouching / crawling. Uses the "/settings/calibration/player_height" setting to determine this.

Definition at line 178 of file AVR_PlayerRig.cs.

179  {
180  float val1 = CameraHeightInRigSpace;
181  float hf = AVR_Settings.get_float("/settings/calibration/player_height");
182 
184  {
185  float val2 = 0.5f * ((leftHandController.transform.position.y - transform.position.y) + (rightHandController.transform.position.y - transform.position.y));
186  return val1 < 0.72f * hf || val2 < 0.36f * hf;
187  }
188  return val1 < hf;
189  }
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.
float CameraHeightInRigSpace
Height of the camera in local space. Equivalent to the distance between HMD from the gorund...
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.