docs.unity.cn
    Show / Hide Table of Contents

    Constructor float4

    float4(Single, Single, Single, Single)

    Constructs a float4 vector from four float values.

    Declaration
    public float4(float x, float y, float z, float w)
    Parameters
    Type Name Description
    Single x

    The constructed vector's x component will be set to this value.

    Single y

    The constructed vector's y component will be set to this value.

    Single z

    The constructed vector's z component will be set to this value.

    Single w

    The constructed vector's w component will be set to this value.

    float4(Single, Single, float2)

    Constructs a float4 vector from two float values and a float2 vector.

    Declaration
    public float4(float x, float y, float2 zw)
    Parameters
    Type Name Description
    Single x

    The constructed vector's x component will be set to this value.

    Single y

    The constructed vector's y component will be set to this value.

    float2 zw

    The constructed vector's zw components will be set to this value.

    float4(Single, float2, Single)

    Constructs a float4 vector from a float value, a float2 vector and a float value.

    Declaration
    public float4(float x, float2 yz, float w)
    Parameters
    Type Name Description
    Single x

    The constructed vector's x component will be set to this value.

    float2 yz

    The constructed vector's yz components will be set to this value.

    Single w

    The constructed vector's w component will be set to this value.

    float4(Single, float3)

    Constructs a float4 vector from a float value and a float3 vector.

    Declaration
    public float4(float x, float3 yzw)
    Parameters
    Type Name Description
    Single x

    The constructed vector's x component will be set to this value.

    float3 yzw

    The constructed vector's yzw components will be set to this value.

    float4(float2, Single, Single)

    Constructs a float4 vector from a float2 vector and two float values.

    Declaration
    public float4(float2 xy, float z, float w)
    Parameters
    Type Name Description
    float2 xy

    The constructed vector's xy components will be set to this value.

    Single z

    The constructed vector's z component will be set to this value.

    Single w

    The constructed vector's w component will be set to this value.

    float4(float2, float2)

    Constructs a float4 vector from two float2 vectors.

    Declaration
    public float4(float2 xy, float2 zw)
    Parameters
    Type Name Description
    float2 xy

    The constructed vector's xy components will be set to this value.

    float2 zw

    The constructed vector's zw components will be set to this value.

    float4(float3, Single)

    Constructs a float4 vector from a float3 vector and a float value.

    Declaration
    public float4(float3 xyz, float w)
    Parameters
    Type Name Description
    float3 xyz

    The constructed vector's xyz components will be set to this value.

    Single w

    The constructed vector's w component will be set to this value.

    float4(float4)

    Constructs a float4 vector from a float4 vector.

    Declaration
    public float4(float4 xyzw)
    Parameters
    Type Name Description
    float4 xyzw

    The constructed vector's xyzw components will be set to this value.

    float4(Single)

    Constructs a float4 vector from a single float value by assigning it to every component.

    Declaration
    public float4(float v)
    Parameters
    Type Name Description
    Single v

    float to convert to float4

    float4(Boolean)

    Constructs a float4 vector from a single bool value by converting it to float and assigning it to every component.

    Declaration
    public float4(bool v)
    Parameters
    Type Name Description
    Boolean v

    bool to convert to float4

    float4(bool4)

    Constructs a float4 vector from a bool4 vector by componentwise conversion.

    Declaration
    public float4(bool4 v)
    Parameters
    Type Name Description
    bool4 v

    bool4 to convert to float4

    float4(Int32)

    Constructs a float4 vector from a single int value by converting it to float and assigning it to every component.

    Declaration
    public float4(int v)
    Parameters
    Type Name Description
    Int32 v

    int to convert to float4

    float4(int4)

    Constructs a float4 vector from a int4 vector by componentwise conversion.

    Declaration
    public float4(int4 v)
    Parameters
    Type Name Description
    int4 v

    int4 to convert to float4

    float4(UInt32)

    Constructs a float4 vector from a single uint value by converting it to float and assigning it to every component.

    Declaration
    public float4(uint v)
    Parameters
    Type Name Description
    UInt32 v

    uint to convert to float4

    float4(uint4)

    Constructs a float4 vector from a uint4 vector by componentwise conversion.

    Declaration
    public float4(uint4 v)
    Parameters
    Type Name Description
    uint4 v

    uint4 to convert to float4

    float4(half)

    Constructs a float4 vector from a single half value by converting it to float and assigning it to every component.

    Declaration
    public float4(half v)
    Parameters
    Type Name Description
    half v

    half to convert to float4

    float4(half4)

    Constructs a float4 vector from a half4 vector by componentwise conversion.

    Declaration
    public float4(half4 v)
    Parameters
    Type Name Description
    half4 v

    half4 to convert to float4

    float4(Double)

    Constructs a float4 vector from a single double value by converting it to float and assigning it to every component.

    Declaration
    public float4(double v)
    Parameters
    Type Name Description
    Double v

    double to convert to float4

    float4(double4)

    Constructs a float4 vector from a double4 vector by componentwise conversion.

    Declaration
    public float4(double4 v)
    Parameters
    Type Name Description
    double4 v

    double4 to convert to float4

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, March 29, 2022
    Terms of use