Class Leap::PoseExtensions¶
- class Leap.PoseExtensions¶
Public Static Functions
- static Matrix4x4 matrix (this Pose ps)¶
-
Returns a Matrix4x4 corresponding to this Pose’s translation and rotation, with unit scale.
- static Pose mul (this Pose A, Pose B)¶
-
Returns Pose B transformed by Pose A, like a transform hierarchy with A as the parent of B.
- static Pose add (this Pose A, Pose B)¶
-
Returns the accumulation of the two Poses: The positions summed, and with rotation A.rotation * B.rotation. Note that this accumulates the Poses without interpreting either Pose as a parent space of the other; but also beware that rotations are noncommutative, so this operation is also noncommutative.
- static Pose mul (this Pose pose, Vector3 localPosition)
Transforms the right-hand-side Vector3 as a local-space position into world space as if this Pose were its reference frame or parent.
- static Pose mul (this Matrix4x4 matrix, Pose localPose)
Non-projective matrices only (MultiplyPoint3x4).
- static Pose Lerp (this Pose a, Pose b, float t)¶
Returns a Pose interpolated (Lerp for position, Slerp, NOT Lerp for rotation) between a and b by t from 0 to 1. This method clamps t between 0 and 1; if extrapolation is desired, see Extrapolate.
- static Pose LerpUnclamped (this Pose a, Pose b, float t)¶
As Lerp, but doesn’t clamp t between 0 and 1. Values above one extrapolate forwards beyond b, while values less than zero extrapolate backwards past a.
- static Pose LerpUnclampedTimed (this Pose a, float aTime, Pose b, float bTime, float extrapolateTime)¶
As LerpUnclamped, but extrapolates using time values for a and b, and a target time at which to determine the extrapolated Pose.
- static Pose ToLocalPose (this Transform t)¶
Creates a Pose using the transform’s localPosition and localRotation.
- static Pose ToWorldPose (this Transform t)¶
Creates a Pose using the transform’s position and rotation.
- static void SetLocalPose (this Transform t, Pose localPose)¶
Sets the localPosition and localRotation of this transform to the argument Pose’s position and rotation.
- static void SetPose (this Transform t, Pose worldPose)¶
Sets the position and rotation of this transform to the argument Pose’s position and rotation. Identical to SetWorldPose.
- static void SetWorldPose (this Transform t, Pose worldPose)¶
Sets the position and rotation of this transform to the argument Pose’s position and rotation. Identical to SetPose.
- static Pose GetPose (this Matrix4x4 m)
Returns the Pose (position and rotation) described by a Matrix4x4.
- static Pose WithRotation (this Pose pose, Quaternion newRotation)¶
Returns a new Pose with the argument rotation instead of the Pose’s current rotation.