docs.unity.cn
    Show / Hide Table of Contents

    Struct float4

    A 4 component vector of floats.

    Inherited Members
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Mathematics
    Syntax
    [Serializable]
    public struct float4 : IEquatable<float4>, IFormattable

    Constructors

    Name Description
    float4(Boolean)

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

    float4(Double)

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

    float4(Int32)

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

    float4(Single)

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

    float4(Single, Single, Single, Single)

    Constructs a float4 vector from four float values.

    float4(Single, Single, float2)

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

    float4(Single, float2, Single)

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

    float4(Single, float3)

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

    float4(UInt32)

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

    float4(bool4)

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

    float4(double4)

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

    float4(float2, Single, Single)

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

    float4(float2, float2)

    Constructs a float4 vector from two float2 vectors.

    float4(float3, Single)

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

    float4(float4)

    Constructs a float4 vector from a float4 vector.

    float4(half)

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

    float4(half4)

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

    float4(int4)

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

    float4(uint4)

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

    Fields

    Name Description
    w

    w component of the vector.

    x

    x component of the vector.

    y

    y component of the vector.

    z

    z component of the vector.

    zero

    float4 zero value.

    Properties

    Name Description
    Item[Int32]

    Returns the float element at a specified index.

    Methods

    Name Description
    Equals(Object)

    Returns true if the float4 is equal to a given float4, false otherwise.

    Equals(float4)

    Returns true if the float4 is equal to a given float4, false otherwise.

    GetHashCode()

    Returns a hash code for the float4.

    ToString()

    Returns a string representation of the float4.

    ToString(String, IFormatProvider)

    Returns a string representation of the float4 using a specified format and culture-specific format information.

    Operators

    Name Description
    Addition(Single, float4)

    Returns the result of a componentwise addition operation on a float value and a float4 vector.

    Addition(float4, Single)

    Returns the result of a componentwise addition operation on a float4 vector and a float value.

    Addition(float4, float4)

    Returns the result of a componentwise addition operation on two float4 vectors.

    Decrement(float4)

    Returns the result of a componentwise decrement operation on a float4 vector.

    Division(Single, float4)

    Returns the result of a componentwise division operation on a float value and a float4 vector.

    Division(float4, Single)

    Returns the result of a componentwise division operation on a float4 vector and a float value.

    Division(float4, float4)

    Returns the result of a componentwise division operation on two float4 vectors.

    Equality(Single, float4)

    Returns the result of a componentwise equality operation on a float value and a float4 vector.

    Equality(float4, Single)

    Returns the result of a componentwise equality operation on a float4 vector and a float value.

    Equality(float4, float4)

    Returns the result of a componentwise equality operation on two float4 vectors.

    Explicit(Boolean to float4)

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

    Explicit(Double to float4)

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

    Explicit(bool4 to float4)

    Explicitly converts a bool4 vector to a float4 vector by componentwise conversion.

    Explicit(double4 to float4)

    Explicitly converts a double4 vector to a float4 vector by componentwise conversion.

    GreaterThan(Single, float4)

    Returns the result of a componentwise greater than operation on a float value and a float4 vector.

    GreaterThan(float4, Single)

    Returns the result of a componentwise greater than operation on a float4 vector and a float value.

    GreaterThan(float4, float4)

    Returns the result of a componentwise greater than operation on two float4 vectors.

    GreaterThanOrEqual(Single, float4)

    Returns the result of a componentwise greater or equal operation on a float value and a float4 vector.

    GreaterThanOrEqual(float4, Single)

    Returns the result of a componentwise greater or equal operation on a float4 vector and a float value.

    GreaterThanOrEqual(float4, float4)

    Returns the result of a componentwise greater or equal operation on two float4 vectors.

    Implicit(Int32 to float4)

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

    Implicit(Single to float4)

    Implicitly converts a single float value to a float4 vector by assigning it to every component.

    Implicit(UInt32 to float4)

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

    Implicit(float4 to Vector4)

    Converts a float4 to Vector4.

    Implicit(half to float4)

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

    Implicit(half4 to float4)

    Implicitly converts a half4 vector to a float4 vector by componentwise conversion.

    Implicit(int4 to float4)

    Implicitly converts a int4 vector to a float4 vector by componentwise conversion.

    Implicit(uint4 to float4)

    Implicitly converts a uint4 vector to a float4 vector by componentwise conversion.

    Implicit(Vector4 to float4)

    Converts a Vector4 to float4.

    Increment(float4)

    Returns the result of a componentwise increment operation on a float4 vector.

    Inequality(Single, float4)

    Returns the result of a componentwise not equal operation on a float value and a float4 vector.

    Inequality(float4, Single)

    Returns the result of a componentwise not equal operation on a float4 vector and a float value.

    Inequality(float4, float4)

    Returns the result of a componentwise not equal operation on two float4 vectors.

    LessThan(Single, float4)

    Returns the result of a componentwise less than operation on a float value and a float4 vector.

    LessThan(float4, Single)

    Returns the result of a componentwise less than operation on a float4 vector and a float value.

    LessThan(float4, float4)

    Returns the result of a componentwise less than operation on two float4 vectors.

    LessThanOrEqual(Single, float4)

    Returns the result of a componentwise less or equal operation on a float value and a float4 vector.

    LessThanOrEqual(float4, Single)

    Returns the result of a componentwise less or equal operation on a float4 vector and a float value.

    LessThanOrEqual(float4, float4)

    Returns the result of a componentwise less or equal operation on two float4 vectors.

    Modulus(Single, float4)

    Returns the result of a componentwise modulus operation on a float value and a float4 vector.

    Modulus(float4, Single)

    Returns the result of a componentwise modulus operation on a float4 vector and a float value.

    Modulus(float4, float4)

    Returns the result of a componentwise modulus operation on two float4 vectors.

    Multiply(Single, float4)

    Returns the result of a componentwise multiplication operation on a float value and a float4 vector.

    Multiply(float4, Single)

    Returns the result of a componentwise multiplication operation on a float4 vector and a float value.

    Multiply(float4, float4)

    Returns the result of a componentwise multiplication operation on two float4 vectors.

    Subtraction(Single, float4)

    Returns the result of a componentwise subtraction operation on a float value and a float4 vector.

    Subtraction(float4, Single)

    Returns the result of a componentwise subtraction operation on a float4 vector and a float value.

    Subtraction(float4, float4)

    Returns the result of a componentwise subtraction operation on two float4 vectors.

    UnaryNegation(float4)

    Returns the result of a componentwise unary minus operation on a float4 vector.

    UnaryPlus(float4)

    Returns the result of a componentwise unary plus operation on a float4 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