Photon Quantum 3.0.0

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Photon.Deterministic.IntVector3 Struct Reference

Represents a three-dimensional vector with integer components. More...

Inherits IEquatable< IntVector3 >.

Classes

class  EqualityComparer
 Represents an equality comparer for IntVector3 objects. More...
 

Public Member Functions

 IntVector3 (int x, int y, int z)
 Constructs a new IntVector3 with the given components. More...
 
bool Equals (IntVector3 other)
 Returns true if the vector is exactly equal to another vector. More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 Returns a hash code for the vector. More...
 
override string ToString ()
 Returns a string representation of the IntVector3. More...
 

Static Public Member Functions

static IntVector3 CeilToInt (FPVector3 v)
 Returns a new IntVector3 with the ceiling of the components of the input vector. More...
 
static IntVector3 Clamp (IntVector3 value, IntVector3 min, IntVector3 max)
 Clamps a IntVector3 value between a minimum and maximum IntVector3 value. More...
 
static FP Distance (IntVector3 a, IntVector3 b)
 Calculates the distance between two IntVector3 points. More...
 
static IntVector3 FloorToInt (FPVector3 v)
 Returns the largest integer less than or equal to the specified floating-point number. More...
 
static IntVector3 Max (IntVector3 a, IntVector3 b)
 Returns a new IntVector3 with the largest components of the input vectors. More...
 
static IntVector3 Min (IntVector3 a, IntVector3 b)
 Returns a new IntVector3 with the smallest components of the input vectors. More...
 
static implicit operator FPVector3 (IntVector3 v)
 Converts a IntVector3 object to FPVector3 object. More...
 
static operator IntVector3 (FPVector3 v)
 Converts a FPVector3 object to a IntVector3 object. More...
 
static Boolean operator!= (IntVector3 a, IntVector3 b)
 Returns true if two vectors are not exactly equal. More...
 
static IntVector3 operator* (Int32 s, IntVector3 v)
 Multiplies each component of v times s . More...
 
static IntVector3 operator* (IntVector3 v, Int32 s)
 Multiplies each component of v times s . More...
 
static IntVector3 operator+ (IntVector3 a, IntVector3 b)
 Adds two vectors. More...
 
static IntVector3 operator- (IntVector3 a, IntVector3 b)
 Subtracts b from a More...
 
static IntVector3 operator- (IntVector3 v)
 Negates each component of v vector. More...
 
static IntVector3 operator/ (IntVector3 v, Int32 s)
 Divides each component of v by s . More...
 
static Boolean operator== (IntVector3 a, IntVector3 b)
 Returns true if two vectors are exactly equal. More...
 
static IntVector3 RoundToInt (FPVector3 v)
 Rounds the components of the given FPVector3 to the nearest integer values. More...
 
static void Serialize (IntVector3 *ptr, IDeterministicFrameSerializer serializer)
 Serializes a IntVector3 to a stream using an IDeterministicFrameSerializer. If the serializer is in writing mode, the method writes the X, Y, and Z components of the vector to the stream. If the serializer is in reading mode, the method reads the X, Y, and Z components from the stream and assigns them to the vector. More...
 

Public Attributes

int X
 The X component of the vector. More...
 
int Y
 The Y component of the vector. More...
 
int Z
 The Z component of the vector. More...
 

Static Public Attributes

static IntVector3 Down => new IntVector3(0, -1, 0)
 Represents the downward direction with coordinates (0, -1, 0). More...
 
static IntVector3 Left => new IntVector3(-1, 0, 0)
 Represents a 3-dimensional vector with integer components. More...
 
static IntVector3 MaxValue => new IntVector3(int.MaxValue, int.MaxValue, int.MaxValue)
 A vector with the components (int.MaxValue, int.MaxValue, int.MaxValue). More...
 
static IntVector3 MinValue => new IntVector3(int.MinValue, int.MinValue, int.MinValue)
 A vector with the components (int.MinValue, int.MinValue, int.MinValue). More...
 
static IntVector3 One => new IntVector3(1, 1, 1)
 The vector representing a coordinate of (1, 1, 1). More...
 
static IntVector3 Right => new IntVector3(1, 0, 0)
 The right direction vector (1, 0, 0). More...
 
const int SIZE = sizeof(int) * 3
 The size of the struct in memory. More...
 
static IntVector3 Up => new IntVector3(0, 1, 0)
 Represents an upward vector with x = 0, y = 1, and z = 0. More...
 
static IntVector3 Zero => new IntVector3(0, 0, 0)
 Represents a zero vector with all components set to 0. More...
 

Properties

FP Magnitude [get]
 Calculates the magnitude (length) of the IntVector3. More...
 
int SqrMagnitude [get]
 Gets the square of the magnitude of the vector. More...
 

Detailed Description

Represents a three-dimensional vector with integer components.

Constructor & Destructor Documentation

◆ IntVector3()

Photon.Deterministic.IntVector3.IntVector3 ( int  x,
int  y,
int  z 
)
inline

Constructs a new IntVector3 with the given components.

Member Function Documentation

◆ GetHashCode()

override int Photon.Deterministic.IntVector3.GetHashCode ( )
inline

Returns a hash code for the vector.

◆ ToString()

override string Photon.Deterministic.IntVector3.ToString ( )
inline

Returns a string representation of the IntVector3.

Returns
A string representation of the IntVector3.

◆ Serialize()

static void Photon.Deterministic.IntVector3.Serialize ( IntVector3 ptr,
IDeterministicFrameSerializer  serializer 
)
inlinestatic

Serializes a IntVector3 to a stream using an IDeterministicFrameSerializer. If the serializer is in writing mode, the method writes the X, Y, and Z components of the vector to the stream. If the serializer is in reading mode, the method reads the X, Y, and Z components from the stream and assigns them to the vector.

Parameters
ptrA pointer to the IntVector3 that is being serialized.
serializerThe IDeterministicFrameSerializer used for serialization.

◆ Distance()

static FP Photon.Deterministic.IntVector3.Distance ( IntVector3  a,
IntVector3  b 
)
inlinestatic

Calculates the distance between two IntVector3 points.

Parameters
aThe first IntVector3 point.
bThe second IntVector3 point.
Returns
The distance between the two IntVector3 points.

◆ Clamp()

static IntVector3 Photon.Deterministic.IntVector3.Clamp ( IntVector3  value,
IntVector3  min,
IntVector3  max 
)
inlinestatic

Clamps a IntVector3 value between a minimum and maximum IntVector3 value.

Parameters
valueThe IntVector3 value to clamp.
minThe minimum IntVector3 value.
maxThe maximum IntVector3 value.
Returns
The clamped IntVector3 value.

◆ Min()

static IntVector3 Photon.Deterministic.IntVector3.Min ( IntVector3  a,
IntVector3  b 
)
inlinestatic

Returns a new IntVector3 with the smallest components of the input vectors.

Parameters
aThe first IntVector3.
bThe second IntVector3.
Returns
A new IntVector3 with the smallest components of the input vectors.

◆ Max()

static IntVector3 Photon.Deterministic.IntVector3.Max ( IntVector3  a,
IntVector3  b 
)
inlinestatic

Returns a new IntVector3 with the largest components of the input vectors.

Parameters
aThe first IntVector3.
bThe second IntVector3.
Returns
A new IntVector3 with the largest components of the input vectors.

◆ RoundToInt()

static IntVector3 Photon.Deterministic.IntVector3.RoundToInt ( FPVector3  v)
inlinestatic

Rounds the components of the given FPVector3 to the nearest integer values.

Parameters
vThe vector to round.
Returns
A new IntVector3 with the rounded integer values.

◆ FloorToInt()

static IntVector3 Photon.Deterministic.IntVector3.FloorToInt ( FPVector3  v)
inlinestatic

Returns the largest integer less than or equal to the specified floating-point number.

Parameters
vThe number to round down.
Returns
The largest integer less than or equal to the specified number.

◆ CeilToInt()

static IntVector3 Photon.Deterministic.IntVector3.CeilToInt ( FPVector3  v)
inlinestatic

Returns a new IntVector3 with the ceiling of the components of the input vector.

Parameters
vThe input vector.
Returns
A new IntVector3 with the ceiling of the components.

◆ operator FPVector3()

static implicit Photon.Deterministic.IntVector3.operator FPVector3 ( IntVector3  v)
inlinestatic

Converts a IntVector3 object to FPVector3 object.

Parameters
vThe IntVector3 object to convert.
Returns
A new FPVector3 object created using the values of the IntVector3 object.

◆ operator IntVector3()

static Photon.Deterministic.IntVector3.operator IntVector3 ( FPVector3  v)
inlineexplicitstatic

Converts a FPVector3 object to a IntVector3 object.

◆ operator==()

static Boolean Photon.Deterministic.IntVector3.operator== ( IntVector3  a,
IntVector3  b 
)
inlinestatic

Returns true if two vectors are exactly equal.

Parameters
a
b
Returns

◆ operator!=()

static Boolean Photon.Deterministic.IntVector3.operator!= ( IntVector3  a,
IntVector3  b 
)
inlinestatic

Returns true if two vectors are not exactly equal.

Parameters
a
b
Returns

◆ operator-() [1/2]

static IntVector3 Photon.Deterministic.IntVector3.operator- ( IntVector3  v)
inlinestatic

Negates each component of v vector.

Parameters
v
Returns

◆ operator*() [1/2]

static IntVector3 Photon.Deterministic.IntVector3.operator* ( IntVector3  v,
Int32  s 
)
inlinestatic

Multiplies each component of v times s .

Parameters
v
s
Returns

◆ operator*() [2/2]

static IntVector3 Photon.Deterministic.IntVector3.operator* ( Int32  s,
IntVector3  v 
)
inlinestatic

Multiplies each component of v times s .

Parameters
v
s
Returns

◆ operator/()

static IntVector3 Photon.Deterministic.IntVector3.operator/ ( IntVector3  v,
Int32  s 
)
inlinestatic

Divides each component of v by s .

Parameters
v
s
Returns

◆ operator-() [2/2]

static IntVector3 Photon.Deterministic.IntVector3.operator- ( IntVector3  a,
IntVector3  b 
)
inlinestatic

Subtracts b from a

Parameters
a
b
Returns

◆ operator+()

static IntVector3 Photon.Deterministic.IntVector3.operator+ ( IntVector3  a,
IntVector3  b 
)
inlinestatic

Adds two vectors.

Parameters
a
b
Returns

◆ Equals()

bool Photon.Deterministic.IntVector3.Equals ( IntVector3  other)
inline

Returns true if the vector is exactly equal to another vector.

Member Data Documentation

◆ SIZE

const int Photon.Deterministic.IntVector3.SIZE = sizeof(int) * 3
static

The size of the struct in memory.

◆ MaxValue

IntVector3 Photon.Deterministic.IntVector3.MaxValue => new IntVector3(int.MaxValue, int.MaxValue, int.MaxValue)
static

A vector with the components (int.MaxValue, int.MaxValue, int.MaxValue).

◆ MinValue

IntVector3 Photon.Deterministic.IntVector3.MinValue => new IntVector3(int.MinValue, int.MinValue, int.MinValue)
static

A vector with the components (int.MinValue, int.MinValue, int.MinValue).

◆ Up

IntVector3 Photon.Deterministic.IntVector3.Up => new IntVector3(0, 1, 0)
static

Represents an upward vector with x = 0, y = 1, and z = 0.

◆ Down

IntVector3 Photon.Deterministic.IntVector3.Down => new IntVector3(0, -1, 0)
static

Represents the downward direction with coordinates (0, -1, 0).

◆ Left

IntVector3 Photon.Deterministic.IntVector3.Left => new IntVector3(-1, 0, 0)
static

Represents a 3-dimensional vector with integer components.

This struct is part of the Photon.Deterministic namespace.

◆ Right

IntVector3 Photon.Deterministic.IntVector3.Right => new IntVector3(1, 0, 0)
static

The right direction vector (1, 0, 0).

The right direction vector.

◆ One

IntVector3 Photon.Deterministic.IntVector3.One => new IntVector3(1, 1, 1)
static

The vector representing a coordinate of (1, 1, 1).

◆ Zero

IntVector3 Photon.Deterministic.IntVector3.Zero => new IntVector3(0, 0, 0)
static

Represents a zero vector with all components set to 0.

◆ X

int Photon.Deterministic.IntVector3.X

The X component of the vector.

◆ Y

int Photon.Deterministic.IntVector3.Y

The Y component of the vector.

◆ Z

int Photon.Deterministic.IntVector3.Z

The Z component of the vector.

Property Documentation

◆ Magnitude

FP Photon.Deterministic.IntVector3.Magnitude
get

Calculates the magnitude (length) of the IntVector3.

The magnitude of the IntVector3.

◆ SqrMagnitude

int Photon.Deterministic.IntVector3.SqrMagnitude
get

Gets the square of the magnitude of the vector.

The square of the magnitude of the vector.