docs.unity.cn
    Show / Hide Table of Contents

    Struct float2

    A 2 component vector of floats.

    Namespace: Unity.Mathematics
    Syntax
    public struct float2 : System.IEquatable<float2>, IFormattable

    Constructors

    Name Description
    float2(Boolean)

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

    float2(Double)

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

    float2(Int32)

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

    float2(Single)

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

    float2(Single, Single)

    Constructs a float2 vector from two float values.

    float2(UInt32)

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

    float2(bool2)

    Constructs a float2 vector from a bool2 vector by componentwise conversion.

    float2(double2)

    Constructs a float2 vector from a double2 vector by componentwise conversion.

    float2(float2)

    Constructs a float2 vector from a float2 vector.

    float2(half)

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

    float2(half2)

    Constructs a float2 vector from a half2 vector by componentwise conversion.

    float2(int2)

    Constructs a float2 vector from a int2 vector by componentwise conversion.

    float2(uint2)

    Constructs a float2 vector from a uint2 vector by componentwise conversion.

    Fields

    Name Description
    x

    x component of the vector.

    y

    y component of the vector.

    zero

    float2 zero value.

    Properties

    Name Description
    Item[Int32]

    Returns the float element at a specified index.

    xx

    Swizzles the vector.

    xxx

    Swizzles the vector.

    xxxx

    Swizzles the vector.

    xxxy

    Swizzles the vector.

    xxy

    Swizzles the vector.

    xxyx

    Swizzles the vector.

    xxyy

    Swizzles the vector.

    xy

    Swizzles the vector.

    xyx

    Swizzles the vector.

    xyxx

    Swizzles the vector.

    xyxy

    Swizzles the vector.

    xyy

    Swizzles the vector.

    xyyx

    Swizzles the vector.

    xyyy

    Swizzles the vector.

    yx

    Swizzles the vector.

    yxx

    Swizzles the vector.

    yxxx

    Swizzles the vector.

    yxxy

    Swizzles the vector.

    yxy

    Swizzles the vector.

    yxyx

    Swizzles the vector.

    yxyy

    Swizzles the vector.

    yy

    Swizzles the vector.

    yyx

    Swizzles the vector.

    yyxx

    Swizzles the vector.

    yyxy

    Swizzles the vector.

    yyy

    Swizzles the vector.

    yyyx

    Swizzles the vector.

    yyyy

    Swizzles the vector.

    Methods

    Name Description
    Equals(Object)

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

    Equals(float2)

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

    GetHashCode()

    Returns a hash code for the float2.

    ToString()

    Returns a string representation of the float2.

    ToString(String, IFormatProvider)

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

    Operators

    Name Description
    Addition(Single, float2)

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

    Addition(float2, Single)

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

    Addition(float2, float2)

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

    Decrement(float2)

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

    Division(Single, float2)

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

    Division(float2, Single)

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

    Division(float2, float2)

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

    Equality(Single, float2)

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

    Equality(float2, Single)

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

    Equality(float2, float2)

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

    Explicit(Boolean to float2)

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

    Explicit(Double to float2)

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

    Explicit(bool2 to float2)

    Explicitly converts a bool2 vector to a float2 vector by componentwise conversion.

    Explicit(double2 to float2)

    Explicitly converts a double2 vector to a float2 vector by componentwise conversion.

    GreaterThan(Single, float2)

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

    GreaterThan(float2, Single)

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

    GreaterThan(float2, float2)

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

    GreaterThanOrEqual(Single, float2)

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

    GreaterThanOrEqual(float2, Single)

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

    GreaterThanOrEqual(float2, float2)

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

    Implicit(Int32 to float2)

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

    Implicit(Single to float2)

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

    Implicit(UInt32 to float2)

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

    Implicit(float2 to Vector2)

    Converts a float2 to Vector2.

    Implicit(half to float2)

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

    Implicit(half2 to float2)

    Implicitly converts a half2 vector to a float2 vector by componentwise conversion.

    Implicit(int2 to float2)

    Implicitly converts a int2 vector to a float2 vector by componentwise conversion.

    Implicit(uint2 to float2)

    Implicitly converts a uint2 vector to a float2 vector by componentwise conversion.

    Implicit(Vector2 to float2)

    Converts a Vector2 to float2.

    Increment(float2)

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

    Inequality(Single, float2)

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

    Inequality(float2, Single)

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

    Inequality(float2, float2)

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

    LessThan(Single, float2)

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

    LessThan(float2, Single)

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

    LessThan(float2, float2)

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

    LessThanOrEqual(Single, float2)

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

    LessThanOrEqual(float2, Single)

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

    LessThanOrEqual(float2, float2)

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

    Modulus(Single, float2)

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

    Modulus(float2, Single)

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

    Modulus(float2, float2)

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

    Multiply(Single, float2)

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

    Multiply(float2, Single)

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

    Multiply(float2, float2)

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

    Subtraction(Single, float2)

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

    Subtraction(float2, Single)

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

    Subtraction(float2, float2)

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

    UnaryNegation(float2)

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

    UnaryPlus(float2)

    Returns the result of a componentwise unary plus operation on a float2 vector.

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