Represents a two-dimensional vector with integer components. More...
Inherits IEquatable< IntVector2 >.
Classes | |
class | EqualityComparer |
Represents an equality comparer for IntVector2 objects. More... | |
Public Member Functions | |
IntVector2 (int x, int y) | |
Initializes a new instance of the IntVector2 struct. More... | |
bool | Equals (IntVector2 other) |
Determines whether the specified IntVector2 is equal to the current IntVector2. More... | |
override bool | Equals (object obj) |
Determines whether the specified object is equal to the current IntVector2. More... | |
override int | GetHashCode () |
Returns a hash code for this instance. More... | |
override string | ToString () |
Returns a string that represents the current IntVector2. More... | |
Static Public Member Functions | |
static IntVector2 | CeilToInt (FPVector2 v) |
Returns a new IntVector2 with the smallest integer greater than or equal to the components of the given FPVector2. More... | |
static IntVector2 | Clamp (IntVector2 value, IntVector2 min, IntVector2 max) |
Clamps a IntVector2 value between a minimum and maximum value. More... | |
static FP | Distance (IntVector2 a, IntVector2 b) |
Calculates the distance between two IntVector2 points. More... | |
static IntVector2 | FloorToInt (FPVector2 v) |
Returns the largest integer less than or equal to the specified floating-point number. More... | |
static IntVector2 | Max (IntVector2 a, IntVector2 b) |
Returns a new IntVector2 with the largest components of the input vectors. More... | |
static IntVector2 | Min (IntVector2 a, IntVector2 b) |
Returns a new IntVector2 with the smallest components of the input vectors. More... | |
static implicit | operator FPVector2 (IntVector2 v) |
Implicitly converts a IntVector2 instance to an FPVector2 instance. This conversion creates a new FPVector2 instance with the X and Y coordinates from the input IntVector2 instance. More... | |
static | operator IntVector2 (FPVector2 v) |
Converts a FPVector2 instance to a IntVector2 instance. More... | |
static bool | operator!= (IntVector2 lhs, IntVector2 rhs) |
Compares two IntVector2 instances for inequality. More... | |
static IntVector2 | operator* (int d, IntVector2 a) |
Multiplies a IntVector2 by an integer scalar. More... | |
static IntVector2 | operator* (IntVector2 a, int d) |
Multiplies a IntVector2 by an integer scalar. More... | |
static IntVector2 | operator+ (IntVector2 a, IntVector2 b) |
Adds two IntVector2 instances. More... | |
static IntVector2 | operator- (IntVector2 a) |
Negates an IntVector2. More... | |
static IntVector2 | operator- (IntVector2 a, IntVector2 b) |
Subtracts the second IntVector2 from the first. More... | |
static IntVector2 | operator/ (IntVector2 a, int d) |
Divides a IntVector2 by an integer scalar. More... | |
static bool | operator== (IntVector2 lhs, IntVector2 rhs) |
Compares two IntVector2 instances for equality. More... | |
static IntVector2 | RoundToInt (FPVector2 v) |
Rounds a FPVector2 to the nearest whole numbers, and returns a new IntVector2. More... | |
static void | Serialize (IntVector2 *ptr, IDeterministicFrameSerializer serializer) |
Serializes or deserializes a IntVector2 struct using the provided IDeterministicFrameSerializer object. More... | |
Public Attributes | |
int | X |
The X component of the vector. More... | |
int | Y |
The Y component of the vector. More... | |
Static Public Attributes | |
static IntVector2 | Down => new IntVector2(0, -1) |
A vector with components (0,-1); More... | |
static IntVector2 | Left => new IntVector2(-1, 0) |
A vector with components (-1,0); More... | |
static IntVector2 | MaxValue => new IntVector2(int.MaxValue, int.MaxValue) |
A vector with components (int.MaxValue, int.MaxValue); More... | |
static IntVector2 | MinValue => new IntVector2(int.MinValue, int.MinValue) |
A vector with components (int.MinValue, int.MinValue); More... | |
static IntVector2 | One => new IntVector2(1, 1) |
A vector with components (1,1); More... | |
static IntVector2 | Right => new IntVector2(1, 0) |
A vector with components (1,0); More... | |
const int | SIZE = sizeof(int) * 2 |
The size of the struct in memory. More... | |
static IntVector2 | Up => new IntVector2(0, 1) |
A vector with components (0,1); More... | |
static IntVector2 | Zero => new IntVector2(0, 0) |
A vector with components (0,0); More... | |
Properties | |
FP | Magnitude [get] |
Gets the magnitude of the vector. More... | |
IntVector3 | OXY [get] |
Returns vector (0, X, Y). More... | |
int | SqrMagnitude [get] |
Gets the squared magnitude of the vector. More... | |
IntVector3 | XOY [get] |
Returns vector (X, 0, Y). More... | |
IntVector2 | XX [get] |
Returns a new IntVector2 using the X and X components of this vector. More... | |
IntVector3 | XXX [get] |
Returns a new IntVector3 using the X, X and X components of this vector. More... | |
IntVector3 | XXY [get] |
Returns a new IntVector3 using the X, X and Y components of this vector. More... | |
IntVector2 | XY [get] |
Returns a new IntVector2 using the X and Y components of this vector. More... | |
IntVector3 | XYO [get] |
Returns vector (X, Y, 0). More... | |
IntVector3 | XYX [get] |
Returns a new IntVector3 using the X, Y and X components of this vector. More... | |
IntVector3 | XYY [get] |
Returns a new IntVector3 using the X, Y and Y components of this vector. More... | |
IntVector2 | YX [get] |
Returns a new IntVector2 using the Y and X components of this vector. More... | |
IntVector3 | YXX [get] |
Returns a new IntVector3 using the Y, X and X components of this vector. More... | |
IntVector3 | YXY [get] |
Returns a new IntVector3 using the Y, X and Y components of this vector. More... | |
IntVector2 | YY [get] |
Returns a new IntVector2 using the Y and Y components of this vector. More... | |
IntVector3 | YYX [get] |
Returns a new IntVector3 using the Y, Y and X components of this vector. More... | |
IntVector3 | YYY [get] |
Returns a new IntVector3 using the Y, Y and Y components of this vector. More... | |
Represents a two-dimensional vector with integer components.
|
inline |
Initializes a new instance of the IntVector2 struct.
x | The x-coordinate of the vector. |
y | The y-coordinate of the vector. |
|
inline |
Returns a hash code for this instance.
|
inline |
Returns a string that represents the current IntVector2.
|
inlinestatic |
Serializes or deserializes a IntVector2 struct using the provided IDeterministicFrameSerializer object.
ptr | A pointer to the IntVector2 struct to serialize or deserialize. |
serializer | The IDeterministicFrameSerializer object used for serialization or deserialization. |
|
inlinestatic |
Clamps a IntVector2 value between a minimum and maximum value.
value | The IntVector2 value to clamp |
min | The minimum IntVector2 value to clamp to |
max | The maximum IntVector2 value to clamp to |
|
inlinestatic |
Calculates the distance between two IntVector2 points.
a | The first IntVector2 point |
b | The second IntVector2 point |
|
inlinestatic |
Returns a new IntVector2 with the largest components of the input vectors.
|
inlinestatic |
Returns a new IntVector2 with the smallest components of the input vectors.
|
inlinestatic |
Rounds a FPVector2 to the nearest whole numbers, and returns a new IntVector2.
v | The FPVector2 to round. |
|
inlinestatic |
Returns the largest integer less than or equal to the specified floating-point number.
v | The floating-point number. |
|
inlinestatic |
Returns a new IntVector2 with the smallest integer greater than or equal to the components of the given FPVector2.
v | The FPVector2 to ceil. |
|
inlinestatic |
Implicitly converts a IntVector2 instance to an FPVector2 instance. This conversion creates a new FPVector2 instance with the X and Y coordinates from the input IntVector2 instance.
v | The IntVector2 instance to convert. |
|
inlineexplicitstatic |
Converts a FPVector2 instance to a IntVector2 instance.
|
inlinestatic |
Adds two IntVector2 instances.
|
inlinestatic |
Subtracts the second IntVector2 from the first.
|
inlinestatic |
Multiplies a IntVector2 by an integer scalar.
|
inlinestatic |
Multiplies a IntVector2 by an integer scalar.
d | |
a |
|
inlinestatic |
Divides a IntVector2 by an integer scalar.
|
inlinestatic |
Compares two IntVector2 instances for equality.
|
inlinestatic |
Compares two IntVector2 instances for inequality.
|
inlinestatic |
Negates an IntVector2.
a |
|
inline |
Determines whether the specified IntVector2 is equal to the current IntVector2.
other | The IntVector2 to compare with the current IntVector2. |
|
inline |
Determines whether the specified object is equal to the current IntVector2.
obj | The object to compare with the current IntVector2. |
|
static |
The size of the struct in memory.
|
static |
A vector with components (0,0);
|
static |
A vector with components (1,1);
|
static |
A vector with components (1,0);
|
static |
A vector with components (-1,0);
|
static |
A vector with components (0,1);
|
static |
A vector with components (0,-1);
|
static |
A vector with components (int.MaxValue, int.MaxValue);
|
static |
A vector with components (int.MinValue, int.MinValue);
int Photon.Deterministic.IntVector2.X |
The X component of the vector.
int Photon.Deterministic.IntVector2.Y |
The Y component of the vector.
|
get |
Returns vector (X, 0, Y).
|
get |
Returns vector (X, Y, 0).
|
get |
Returns vector (0, X, Y).
|
get |
Gets the magnitude of the vector.
|
get |
Gets the squared magnitude of the vector.
|
get |
Returns a new IntVector3 using the X, X and X components of this vector.
|
get |
Returns a new IntVector3 using the X, X and Y components of this vector.
|
get |
Returns a new IntVector3 using the X, Y and X components of this vector.
|
get |
Returns a new IntVector3 using the X, Y and Y components of this vector.
|
get |
Returns a new IntVector2 using the X and X components of this vector.
|
get |
Returns a new IntVector2 using the X and Y components of this vector.
|
get |
Returns a new IntVector3 using the Y, Y and Y components of this vector.
|
get |
Returns a new IntVector3 using the Y, Y and X components of this vector.
|
get |
Returns a new IntVector3 using the Y, X and Y components of this vector.
|
get |
Returns a new IntVector3 using the Y, X and X components of this vector.
|
get |
Returns a new IntVector2 using the Y and Y components of this vector.
|
get |
Returns a new IntVector2 using the Y and X components of this vector.