Struct Leap::LeapTransform¶
- struct Leap.LeapTransform¶
The LeapTransform class represents a transform in three dimensional space.
Note that the LeapTransform class replaces the Leap.Matrix class.
- Since
3.1.2
Public Functions
- LeapTransform (Vector3 translation, Quaternion rotation)¶
Constructs a new transform from the specified translation and rotation.
- LeapTransform (Vector3 translation, Quaternion rotation, Vector3 scale)
Constructs a new transform from the specified translation, rotation and scale.
- LeapTransform (Transform t)
Constructs a new Leap transform from a Unity Transform
- Param t
Unity Transform
- Vector3 TransformPoint (Vector3 point)¶
Transforms the specified position vector, applying translation, rotation and scale.
- Vector3 TransformDirection (Vector3 direction)¶
Transforms the specified direction vector, applying rotation only.
- Vector3 TransformVelocity (Vector3 velocity)¶
Transforms the specified velocity vector, applying rotation and scale.
- Quaternion TransformQuaternion (Quaternion rhs)¶
Transforms the specified quaternion. Multiplies the quaternion representing the rotational part of this transform by the specified quaternion.
Important: Modifying the basis vectors of this transform directly leaves the underlying quaternion in an indeterminate state. Neither this function nor the LeapTransform.rotation quaternion can be used after the basis vectors are set.
- void MirrorX ()¶
Mirrors this transform’s rotation and scale across the x-axis. Translation is not affected.
- Since
3.1.2
- void MirrorZ ()¶
Mirrors this transform’s rotation and scale across the z-axis. Translation is not affected.
- Since
3.1.2
Properties
- Vector3 xBasis { get; set; }¶
The x-basis of the transform.
Important: Modifying the basis vectors of this transform directly leaves the underlying quaternion in an indeterminate state. Neither the TransformQuaternion() function nor the LeapTransform.rotation quaternion can be used after the basis vectors are set.
- Since
3.1.2
- Vector3 yBasis { get; set; }¶
The y-basis of the transform.
Important: Modifying the basis vectors of this transform directly leaves the underlying quaternion in an indeterminate state. Neither the TransformQuaternion() function nor the LeapTransform.rotation quaternion can be used after the basis vectors are set.
- Since
3.1.2
- Vector3 zBasis { get; set; }¶
The z-basis of the transform.
Important: Modifying the basis vectors of this transform directly leaves the underlying quaternion in an indeterminate state. Neither the TransformQuaternion() function nor the LeapTransform.rotation quaternion can be used after the basis vectors are set.
- Since
3.1.2
- Vector3 scale { get; set; }¶
The scale factors of the transform. Scale is kept separate from translation.
- Since
3.1.2
- Quaternion rotation { get; set; }¶
The rotational component of the transform.
Important: Modifying the basis vectors of this transform directly leaves the underlying quaternion in an indeterminate state. This rotation quaternion cannot be accessed after the basis vectors are modified directly.
- Since
3.1.2
Public Static Attributes
- static readonlyLeapTransform Identity = new LeapTransform(Vector3.zero, Quaternion.identity, Vector3.one)¶
The identity transform.
- Since
3.1.2