Class AttachPointVelocityTracker
Tracks the velocity and angular velocity of an attachment point in an XR interaction context. It uses weighted linear regression to calculate velocities over a series of frames, providing smooth and accurate results.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Attachment
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[MovedFrom("UnityEngine.XR.Interaction.Toolkit.Interaction")]
public class AttachPointVelocityTracker : IAttachPointVelocityTracker, IAttachPointVelocityProvider
Methods
GetAttachPointAngularVelocity()
Retrieves the current angular velocity of the attachment point.
Declaration
public Vector3 GetAttachPointAngularVelocity()
Returns
Type | Description |
---|---|
Vector3 | The current angular velocity of the attachment point as a Vector3. |
GetAttachPointVelocity()
Retrieves the current linear velocity of the attachment point.
Declaration
public Vector3 GetAttachPointVelocity()
Returns
Type | Description |
---|---|
Vector3 | The current linear velocity of the attachment point as a Vector3. |
UpdateAttachPointVelocityData(Transform)
Updates attach point velocity data using only the attachment transform.
Declaration
public void UpdateAttachPointVelocityData(Transform attachTransform)
Parameters
Type | Name | Description |
---|---|---|
Transform | attachTransform | The transform of the attachment point. |
UpdateAttachPointVelocityData(Transform, Transform)
Updates attach point velocity data using the attachment transform and an XR Origin Transform.
Declaration
public void UpdateAttachPointVelocityData(Transform attachTransform, Transform xrOriginTransform)
Parameters
Type | Name | Description |
---|---|---|
Transform | attachTransform | The transform of the attachment point. |
Transform | xrOriginTransform | The XR Origin Transform for relative calculations. |