docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetDesiredForwardDirection

    GetDesiredForwardDirection(float3, float3)

    Converts a world space vector into a relative vector w.r.t. the current main camera.

    Declaration
    public static float3 GetDesiredForwardDirection(float3 absoluteLinearVelocity, float3 forwardDirection)
    Parameters
    Type Name Description
    float3 absoluteLinearVelocity

    The world space vector to be converted.

    float3 forwardDirection

    The default forward direction, used if the linear velocity is zero.

    Returns
    Type Description
    float3

    The converted view-direction relative vector.

    GetDesiredForwardDirection(float3, float3, float3)

    Converts a world space vector into a relative vector.

    Declaration
    public static float3 GetDesiredForwardDirection(float3 absoluteLinearVelocity, float3 forwardDirection, float3 cameraForward)
    Parameters
    Type Name Description
    float3 absoluteLinearVelocity

    The world space vector to be converted.

    float3 forwardDirection

    The default forward direction, used if the linear velocity is zero.

    float3 cameraForward

    The view direction to be used for the conversion.

    Returns
    Type Description
    float3

    The converted view-direction relative vector.

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