Definition at line 288 of file AVR_PoseProvider.cs. 291 // Calculation of lean_conf, which indicates our confidence of whether the palyer is leaning forwards or standing upright.
303 // We apply inertia to the main cameras position, to avoid unnecessary micro-movement. Note: We do not apply this to the lookat-target, so the head rotation will be fully responsive.
304 eyeTransform.position = ApplyInertia(eyeTransform.position, playerRig.MainCamera.transform.position);
306 // Here we apply clamping bounds on the pitch and roll angles of the head. We deal with yaw in a separate function.
307 //NOTE / TODO: This could lead to problems, as we use localRotation of the camera here. If, say, the camera was in a child object of the GenericXRDevice object, the local rotation would be zero.
309 r = AVR.Core.Utils.Geom.ClampQuaternionRotation(r, new Vector3(max_head_pitch, 360, max_head_roll));
323 // We designate an "unsafe position/rotation", which corresponds to our leaning transform, depending on our leaning-confidence value.
327 // The unsafe position corresponds to the position/rotation we believe the body has *based on our lean_conf value*.
329 // We interpolate between our "unsafe" (the higher) position and the regular, standing-upright (lower) position, based on the distance of the body to the ground (pivot)
350 pivotTransform.position.y + Mathf.Clamp(bodyTransform.position.y - pivotTransform.position.y, min_body_height, max_body_height),
Transform pivotTransform Definition: AVR_PoseProvider.cs:187 float min_body_height Minimum height of the body/torso fromt he ground Definition: AVR_PoseProvider.cs:237 float max_body_height Maximum height of the body/torso fromt he ground Definition: AVR_PoseProvider.cs:231 float max_head_roll Maximum roll angle of the head in relation of the body Definition: AVR_PoseProvider.cs:219 void GetLeanTransform(out Quaternion rot, out Vector3 pos) Definition: AVR_PoseProvider.cs:379 float isLeaningForwardsConfidence() Returns a confidence value of how much the player is leaning forwards / bowing. Definition: AVR_PlayerRig.cs:202 float max_head_pitch Maximum pitch angle of the head in relation of the body Definition: AVR_PoseProvider.cs:213 Vector3 ApplyInertia(Vector3 current, Vector3 target) Definition: AVR_PoseProvider.cs:282 void GetStandingTransform(out Quaternion rot, out Vector3 pos) Definition: AVR_PoseProvider.cs:370 AVR_PlayerRig playerRig The current AVR_PlayerRig instance in the scene Definition: AVR_Behaviour.cs:23 float lean_blend_speed Blending speed between a leaning and standing position Definition: AVR_PoseProvider.cs:201 |