docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRCameraForwardXZAlignment

    Transformation that rotates the target's originTransform about the axis aligned with the Origin's up vector and passing through the world position of the Unity.XR.CoreUtils.XROrigin.Camera, such that the projection of the camera's forward vector onto the Origin's XZ plane matches the projection of the specified vector onto the Origin's XZ plane.

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

    Properties

    targetDirection

    Vector that the forward vector of the Unity.XR.CoreUtils.XROrigin.Camera should match when both are projected onto the XZ plane of the originTransform.

    Declaration
    public Vector3 targetDirection { get; set; }
    Property Value
    Type Description
    Vector3

    Methods

    Apply(XRMovableBody)

    Performs the transformation on the given body.

    Declaration
    public virtual void Apply(XRMovableBody body)
    Parameters
    Type Name Description
    XRMovableBody body

    The body whose originTransform to transform.

    Implements

    IXRBodyTransformation
    In This Article
    Back to top
    Copyright © 2025 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)