Class ScriptableConstrainedBodyManipulator
Base for a scriptable object that can perform movement of an XRMovableBody that is constrained by collision based on where the user's body is.
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public abstract class ScriptableConstrainedBodyManipulator : ScriptableObject, IConstrainedXRBodyManipulator
Properties
isGrounded
Whether the linkedBody is touching the ground, as of the most recent call to MoveBody(Vector3).
Declaration
public abstract bool isGrounded { get; }
Property Value
Type | Description |
---|---|
bool |
lastCollisionFlags
Flags indicating the direction of the collision from the most recent call to MoveBody(Vector3).
Declaration
public abstract CollisionFlags lastCollisionFlags { get; }
Property Value
Type | Description |
---|---|
CollisionFlags |
linkedBody
The body whose originTransform to move.
Declaration
public XRMovableBody linkedBody { get; }
Property Value
Type | Description |
---|---|
XRMovableBody |
See Also
Methods
MoveBody(Vector3)
Applies the given motion to linkedBody. A collision can constrain the movement from taking place.
Declaration
public abstract CollisionFlags MoveBody(Vector3 motion)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | motion | Amount of translation to apply. |
Returns
Type | Description |
---|---|
CollisionFlags | Returns flags that indicate the direction of the collision, if there was one. |
OnLinkedToBody(XRMovableBody)
Called after the given body links this manipulator to it. The implementation should ensure that
linkedBody points to body
after this method is called.
Declaration
public virtual void OnLinkedToBody(XRMovableBody body)
Parameters
Type | Name | Description |
---|---|---|
XRMovableBody | body | The body linked with this manipulator. |
See Also
OnUnlinkedFromBody()
Called when a body unlinks this manipulator from it. The implementation should ensure that linkedBody returns null after this method is called.
Declaration
public virtual void OnUnlinkedFromBody()