Struct int2
A 2 component vector of ints.
Namespace: Unity.Mathematics
Syntax
public struct int2 : System.IEquatable<int2>, IFormattable
Constructors
| Name | Description |
|---|---|
| int2(Boolean) | Constructs a int2 vector from a single bool value by converting it to int and assigning it to every component. |
| int2(Double) | Constructs a int2 vector from a single double value by converting it to int and assigning it to every component. |
| int2(Int32) | Constructs a int2 vector from a single int value by assigning it to every component. |
| int2(Int32, Int32) | Constructs a int2 vector from two int values. |
| int2(Single) | Constructs a int2 vector from a single float value by converting it to int and assigning it to every component. |
| int2(UInt32) | Constructs a int2 vector from a single uint value by converting it to int and assigning it to every component. |
| int2(bool2) | Constructs a int2 vector from a bool2 vector by componentwise conversion. |
| int2(double2) | Constructs a int2 vector from a double2 vector by componentwise conversion. |
| int2(float2) | Constructs a int2 vector from a float2 vector by componentwise conversion. |
| int2(int2) | Constructs a int2 vector from an int2 vector. |
| int2(uint2) | Constructs a int2 vector from a uint2 vector by componentwise conversion. |
Fields
| Name | Description |
|---|---|
| x | x component of the vector. |
| y | y component of the vector. |
| zero | int2 zero value. |
Properties
| Name | Description |
|---|---|
| Item[Int32] | Returns the int 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 int2 is equal to a given int2, false otherwise. |
| Equals(int2) | Returns true if the int2 is equal to a given int2, false otherwise. |
| GetHashCode() | Returns a hash code for the int2. |
| ToString() | Returns a string representation of the int2. |
| ToString(String, IFormatProvider) | Returns a string representation of the int2 using a specified format and culture-specific format information. |
Operators
| Name | Description |
|---|---|
| Addition(Int32, int2) | Returns the result of a componentwise addition operation on an int value and an int2 vector. |
| Addition(int2, Int32) | Returns the result of a componentwise addition operation on an int2 vector and an int value. |
| Addition(int2, int2) | Returns the result of a componentwise addition operation on two int2 vectors. |
| BitwiseAnd(Int32, int2) | Returns the result of a componentwise bitwise and operation on an int value and an int2 vector. |
| BitwiseAnd(int2, Int32) | Returns the result of a componentwise bitwise and operation on an int2 vector and an int value. |
| BitwiseAnd(int2, int2) | Returns the result of a componentwise bitwise and operation on two int2 vectors. |
| BitwiseOr(Int32, int2) | Returns the result of a componentwise bitwise or operation on an int value and an int2 vector. |
| BitwiseOr(int2, Int32) | Returns the result of a componentwise bitwise or operation on an int2 vector and an int value. |
| BitwiseOr(int2, int2) | Returns the result of a componentwise bitwise or operation on two int2 vectors. |
| Decrement(int2) | Returns the result of a componentwise decrement operation on an int2 vector. |
| Division(Int32, int2) | Returns the result of a componentwise division operation on an int value and an int2 vector. |
| Division(int2, Int32) | Returns the result of a componentwise division operation on an int2 vector and an int value. |
| Division(int2, int2) | Returns the result of a componentwise division operation on two int2 vectors. |
| Equality(Int32, int2) | Returns the result of a componentwise equality operation on an int value and an int2 vector. |
| Equality(int2, Int32) | Returns the result of a componentwise equality operation on an int2 vector and an int value. |
| Equality(int2, int2) | Returns the result of a componentwise equality operation on two int2 vectors. |
| ExclusiveOr(Int32, int2) | Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2 vector. |
| ExclusiveOr(int2, Int32) | Returns the result of a componentwise bitwise exclusive or operation on an int2 vector and an int value. |
| ExclusiveOr(int2, int2) | Returns the result of a componentwise bitwise exclusive or operation on two int2 vectors. |
| Explicit(Boolean to int2) | Explicitly converts a single bool value to a int2 vector by converting it to int and assigning it to every component. |
| Explicit(Double to int2) | Explicitly converts a single double value to a int2 vector by converting it to int and assigning it to every component. |
| Explicit(Single to int2) | Explicitly converts a single float value to a int2 vector by converting it to int and assigning it to every component. |
| Explicit(UInt32 to int2) | Explicitly converts a single uint value to a int2 vector by converting it to int and assigning it to every component. |
| Explicit(bool2 to int2) | Explicitly converts a bool2 vector to a int2 vector by componentwise conversion. |
| Explicit(double2 to int2) | Explicitly converts a double2 vector to a int2 vector by componentwise conversion. |
| Explicit(float2 to int2) | Explicitly converts a float2 vector to a int2 vector by componentwise conversion. |
| Explicit(uint2 to int2) | Explicitly converts a uint2 vector to a int2 vector by componentwise conversion. |
| GreaterThan(Int32, int2) | Returns the result of a componentwise greater than operation on an int value and an int2 vector. |
| GreaterThan(int2, Int32) | Returns the result of a componentwise greater than operation on an int2 vector and an int value. |
| GreaterThan(int2, int2) | Returns the result of a componentwise greater than operation on two int2 vectors. |
| GreaterThanOrEqual(Int32, int2) | Returns the result of a componentwise greater or equal operation on an int value and an int2 vector. |
| GreaterThanOrEqual(int2, Int32) | Returns the result of a componentwise greater or equal operation on an int2 vector and an int value. |
| GreaterThanOrEqual(int2, int2) | Returns the result of a componentwise greater or equal operation on two int2 vectors. |
| Implicit(Int32 to int2) | Implicitly converts a single int value to a int2 vector by assigning it to every component. |
| Increment(int2) | Returns the result of a componentwise increment operation on an int2 vector. |
| Inequality(Int32, int2) | Returns the result of a componentwise not equal operation on an int value and an int2 vector. |
| Inequality(int2, Int32) | Returns the result of a componentwise not equal operation on an int2 vector and an int value. |
| Inequality(int2, int2) | Returns the result of a componentwise not equal operation on two int2 vectors. |
| LeftShift(int2, Int32) | Returns the result of a componentwise left shift operation on an int2 vector by a number of bits specified by a single int. |
| LessThan(Int32, int2) | Returns the result of a componentwise less than operation on an int value and an int2 vector. |
| LessThan(int2, Int32) | Returns the result of a componentwise less than operation on an int2 vector and an int value. |
| LessThan(int2, int2) | Returns the result of a componentwise less than operation on two int2 vectors. |
| LessThanOrEqual(Int32, int2) | Returns the result of a componentwise less or equal operation on an int value and an int2 vector. |
| LessThanOrEqual(int2, Int32) | Returns the result of a componentwise less or equal operation on an int2 vector and an int value. |
| LessThanOrEqual(int2, int2) | Returns the result of a componentwise less or equal operation on two int2 vectors. |
| Modulus(Int32, int2) | Returns the result of a componentwise modulus operation on an int value and an int2 vector. |
| Modulus(int2, Int32) | Returns the result of a componentwise modulus operation on an int2 vector and an int value. |
| Modulus(int2, int2) | Returns the result of a componentwise modulus operation on two int2 vectors. |
| Multiply(Int32, int2) | Returns the result of a componentwise multiplication operation on an int value and an int2 vector. |
| Multiply(int2, Int32) | Returns the result of a componentwise multiplication operation on an int2 vector and an int value. |
| Multiply(int2, int2) | Returns the result of a componentwise multiplication operation on two int2 vectors. |
| OnesComplement(int2) | Returns the result of a componentwise bitwise not operation on an int2 vector. |
| RightShift(int2, Int32) | Returns the result of a componentwise right shift operation on an int2 vector by a number of bits specified by a single int. |
| Subtraction(Int32, int2) | Returns the result of a componentwise subtraction operation on an int value and an int2 vector. |
| Subtraction(int2, Int32) | Returns the result of a componentwise subtraction operation on an int2 vector and an int value. |
| Subtraction(int2, int2) | Returns the result of a componentwise subtraction operation on two int2 vectors. |
| UnaryNegation(int2) | Returns the result of a componentwise unary minus operation on an int2 vector. |
| UnaryPlus(int2) | Returns the result of a componentwise unary plus operation on an int2 vector. |