docs.unity.cn
    Show / Hide Table of Contents

    Method project

    project(float2, float2)

    Compute vector projection of a onto b.

    Declaration
    public static float2 project(float2 a, float2 ontoB)
    Parameters
    Type Name Description
    float2 a

    Vector to project.

    float2 ontoB

    Non-zero vector to project onto.

    Returns
    Type Description
    float2

    Vector projection of a onto b.

    Remarks

    Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Single.MaxValue) or when b's components are very small (close to FLT_MIN_NORMAL). In these cases, you can call projectsafe(float2, float2, float2) which will use a given default value if the result is not finite.

    project(float3, float3)

    Compute vector projection of a onto b.

    Declaration
    public static float3 project(float3 a, float3 ontoB)
    Parameters
    Type Name Description
    float3 a

    Vector to project.

    float3 ontoB

    Non-zero vector to project onto.

    Returns
    Type Description
    float3

    Vector projection of a onto b.

    Remarks

    Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Single.MaxValue) or when b's components are very small (close to FLT_MIN_NORMAL). In these cases, you can call projectsafe(float3, float3, float3) which will use a given default value if the result is not finite.

    project(float4, float4)

    Compute vector projection of a onto b.

    Declaration
    public static float4 project(float4 a, float4 ontoB)
    Parameters
    Type Name Description
    float4 a

    Vector to project.

    float4 ontoB

    Non-zero vector to project onto.

    Returns
    Type Description
    float4

    Vector projection of a onto b.

    Remarks

    Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Single.MaxValue) or when b's components are very small (close to FLT_MIN_NORMAL). In these cases, you can call projectsafe(float4, float4, float4) which will use a given default value if the result is not finite.

    project(double2, double2)

    Compute vector projection of a onto b.

    Declaration
    public static double2 project(double2 a, double2 ontoB)
    Parameters
    Type Name Description
    double2 a

    Vector to project.

    double2 ontoB

    Non-zero vector to project onto.

    Returns
    Type Description
    double2

    Vector projection of a onto b.

    Remarks

    Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Double.MaxValue) or when b's components are very small (close to DBL_MIN_NORMAL). In these cases, you can call projectsafe(double2, double2, double2) which will use a given default value if the result is not finite.

    project(double3, double3)

    Compute vector projection of a onto b.

    Declaration
    public static double3 project(double3 a, double3 ontoB)
    Parameters
    Type Name Description
    double3 a

    Vector to project.

    double3 ontoB

    Non-zero vector to project onto.

    Returns
    Type Description
    double3

    Vector projection of a onto b.

    Remarks

    Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Double.MaxValue) or when b's components are very small (close to DBL_MIN_NORMAL). In these cases, you can call projectsafe(double3, double3, double3) which will use a given default value if the result is not finite.

    project(double4, double4)

    Compute vector projection of a onto b.

    Declaration
    public static double4 project(double4 a, double4 ontoB)
    Parameters
    Type Name Description
    double4 a

    Vector to project.

    double4 ontoB

    Non-zero vector to project onto.

    Returns
    Type Description
    double4

    Vector projection of a onto b.

    Remarks

    Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Double.MaxValue) or when b's components are very small (close to DBL_MIN_NORMAL). In these cases, you can call projectsafe(double4, double4, double4) which will use a given default value if the result is not finite.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023