UxrMathUtils.ApplyAlignment Method
Applies to position and rotation the transformation to make a transform defined by sourcePosition and sourceRotation move and rotate to targetPosition and targetRotation.
Namespace: UltimateXR.Core.Math
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static void ApplyAlignment(
ref Vector3 position,
ref Quaternion rotation,
Vector3 sourcePosition,
Quaternion sourceRotation,
Vector3 targetPosition,
Quaternion targetRotation,
bool rotate,
bool translate,
float t = 1f
)
Parameters
- position
- Type: Vector3
Position to apply the transformation to - rotation
- Type: Quaternion
Rotation to apply the transformation to - sourcePosition
- Type: Vector3
Source position that will try to match targetPosition - sourceRotation
- Type: Quaternion
Source rotation that will try to match 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]