docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class XRMovableBody

    Container for an XROrigin that can be transformed using the user's body as a frame of reference.

    Inheritance
    object
    XRMovableBody
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion
    Assembly: solution.dll
    Syntax
    public class XRMovableBody

    Constructors

    Name Description
    XRMovableBody(XROrigin, IXRBodyPositionEvaluator)

    Initializes a new instance of a movable body.

    Properties

    Name Description
    bodyPositionEvaluator

    The object that determines the position of the user's body.

    constrainedManipulator

    Object that can be used to perform movement that is constrained by collision (optional, may be null).

    originTransform

    The Transform component of the Origin of the xrOrigin. This is the Transform component that is manipulated to move the body.

    xrOrigin

    The XR Origin whose Origin is transformed to move the body.

    Methods

    Name Description
    GetBodyGroundLocalPosition()

    Gets the position of where the user's body is grounded (e.g. their feet), in the local space of the originTransform, based on the bodyPositionEvaluator.

    GetBodyGroundWorldPosition()

    Gets the world position of where the user's body is grounded (e.g. their feet), based on the bodyPositionEvaluator.

    LinkConstrainedManipulator(IConstrainedXRBodyManipulator)

    Links the given constrained manipulator to this body. This sets constrainedManipulator to manipulator and calls OnLinkedToBody(XRMovableBody) on the manipulator.

    UnlinkConstrainedManipulator()

    Unlinks the assigned constrained manipulator from this body, if there is one. This calls OnUnlinkedFromBody() on the manipulator and sets constrainedManipulator to null.

    See Also

    IXRBodyTransformation
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)