docs.unity.cn
    Show / Hide Table of Contents

    Method reflect

    reflect(float2, float2)

    Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0f * dot(i, n) * n.

    Declaration
    public static float2 reflect(float2 i, float2 n)
    Parameters
    Type Name Description
    float2 i

    Incident vector.

    float2 n

    Normal vector.

    Returns
    Type Description
    float2

    Reflection vector.

    reflect(float3, float3)

    Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0f * dot(i, n) * n.

    Declaration
    public static float3 reflect(float3 i, float3 n)
    Parameters
    Type Name Description
    float3 i

    Incident vector.

    float3 n

    Normal vector.

    Returns
    Type Description
    float3

    Reflection vector.

    reflect(float4, float4)

    Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0f * dot(i, n) * n.

    Declaration
    public static float4 reflect(float4 i, float4 n)
    Parameters
    Type Name Description
    float4 i

    Incident vector.

    float4 n

    Normal vector.

    Returns
    Type Description
    float4

    Reflection vector.

    reflect(double2, double2)

    Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0 * dot(i, n) * n.

    Declaration
    public static double2 reflect(double2 i, double2 n)
    Parameters
    Type Name Description
    double2 i

    Incident vector.

    double2 n

    Normal vector.

    Returns
    Type Description
    double2

    Reflection vector.

    reflect(double3, double3)

    Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0 * dot(i, n) * n.

    Declaration
    public static double3 reflect(double3 i, double3 n)
    Parameters
    Type Name Description
    double3 i

    Incident vector.

    double3 n

    Normal vector.

    Returns
    Type Description
    double3

    Reflection vector.

    reflect(double4, double4)

    Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0 * dot(i, n) * n.

    Declaration
    public static double4 reflect(double4 i, double4 n)
    Parameters
    Type Name Description
    double4 i

    Incident vector.

    double4 n

    Normal vector.

    Returns
    Type Description
    double4

    Reflection vector.

    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