TransformExt.ApplyAlignment Method (Transform, Vector3, Quaternion, Vector3, Quaternion, Boolean, Boolean, Single)

Applies the transformation to make a transform defined by sourcePosition and sourceRotation move and rotate to targetPosition and targetRotation.

Namespace: UltimateXR.Extensions.Unity
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public static void ApplyAlignment(
	this Transform transform,
	Vector3 sourcePosition,
	Quaternion sourceRotation,
	Vector3 targetPosition,
	Quaternion targetRotation,
	bool rotate,
	bool translate,
	float t = 1f
)

Parameters

 

transform
Type: Transform
Transform to apply the alignment 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]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Transform. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

TransformExt Class
ApplyAlignment Overload
UltimateXR.Extensions.Unity Namespace