Class XRMovableBody
Container for an XROrigin that can be transformed using the user's body as a frame of reference.
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.Locomotion
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public class XRMovableBody
Constructors
XRMovableBody(XROrigin, IXRBodyPositionEvaluator)
Initializes a new instance of a movable body.
Declaration
public XRMovableBody(XROrigin xrOrigin, IXRBodyPositionEvaluator bodyPositionEvaluator)
Parameters
Type | Name | Description |
---|---|---|
XROrigin | xrOrigin | The XR Origin associated with the body. |
IXRBody |
bodyPositionEvaluator | The object that determines the position of the user's body. |
See Also
Properties
bodyPositionEvaluator
The object that determines the position of the user's body.
Declaration
public IXRBodyPositionEvaluator bodyPositionEvaluator { get; }
Property Value
Type | Description |
---|---|
IXRBody |
See Also
constrainedManipulator
Object that can be used to perform movement that is constrained by collision (optional, may be null).
Declaration
public IConstrainedXRBodyManipulator constrainedManipulator { get; }
Property Value
Type | Description |
---|---|
IConstrained |
See Also
originTransform
The Transform component of the Origin of the xr
Declaration
public Transform originTransform { get; }
Property Value
Type | Description |
---|---|
Transform |
See Also
xrOrigin
The XR Origin whose Origin is transformed to move the body.
Declaration
public XROrigin xrOrigin { get; }
Property Value
Type | Description |
---|---|
XROrigin |
See Also
Methods
GetBodyGroundLocalPosition()
Gets the position of where the user's body is grounded (e.g. their feet), in the local space of the
origin
Declaration
public Vector3 GetBodyGroundLocalPosition()
Returns
Type | Description |
---|---|
Vector3 | Returns the position of where the user's body is grounded, in the local space of the origin |
See Also
GetBodyGroundWorldPosition()
Gets the world position of where the user's body is grounded (e.g. their feet), based on the
body
Declaration
public Vector3 GetBodyGroundWorldPosition()
Returns
Type | Description |
---|---|
Vector3 | Returns the world position of where the user's body is grounded. |
See Also
LinkConstrainedManipulator(IConstrainedXRBodyManipulator)
Links the given constrained manipulator to this body. This sets constrainedmanipulator
and calls On
Declaration
public void LinkConstrainedManipulator(IConstrainedXRBodyManipulator manipulator)
Parameters
Type | Name | Description |
---|---|---|
IConstrained |
manipulator | The constrained manipulator to link. |
Remarks
If constrainedmanipulator
already has a linked
See Also
UnlinkConstrainedManipulator()
Unlinks the assigned constrained manipulator from this body, if there is one. This calls
On
Declaration
public void UnlinkConstrainedManipulator()