TransformExt.ApplyAlignment Method (Vector3, Quaternion, Vector3, Quaternion, Vector3, Quaternion, Boolean, Boolean, Single)
Moves rootPosition and rotates rootRotation so that a child defined by childPosition and childRotation gets aligned to targetPosition and targetRotation.
Namespace: UltimateXR.Extensions.Unity
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static void ApplyAlignment(
ref Vector3 rootPosition,
ref Quaternion rootRotation,
Vector3 childPosition,
Quaternion childRotation,
Vector3 targetPosition,
Quaternion targetRotation,
bool rotate,
bool translate,
float t = 1f
)
Parameters
- rootPosition
- Type: Vector3
Position of the root object - rootRotation
- Type: Quaternion
Rotation of the root object - childPosition
- Type: Vector3
Position of the child object that will try to align to targetPosition - childRotation
- Type: Quaternion
Rotation of the child object that will try to align to targetRotation - targetPosition
- Type: Vector3
Target position - targetRotation
- Type: Quaternion
Target rotation - rotate
- Type: System.Boolean
Allows to control whether to rotate or not - translate
- Type: System.Boolean
Allows to control whether to translate or not - t (Optional)
- Type: System.Single
Optional interpolation value [0.0, 1.0]
See Also
Reference
TransformExt Class
ApplyAlignment Overload
UltimateXR.Extensions.Unity Namespace