Photon Quantum 3.0.0

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

Represents an 3D axis aligned bounding box (AABB). More...

Public Member Functions

 FPBounds3 (FPVector3 center, FPVector3 extents)
 Create a new Bounds with the given center and extents. More...
 
void Encapsulate (FPBounds3 bounds)
 Expand bounds to contain bounds (if needed). More...
 
void Encapsulate (FPVector3 point)
 Expand bounds to contain point (if needed). More...
 
void Expand (FP amount)
 Expand bounds by 0.5 * amount in both directions. More...
 
void Expand (FPVector3 amount)
 Expand bounds by 0.5 * amount in both directions. More...
 
override int GetHashCode ()
 Computes a hash code for the current instance of the FPBounds3 class. More...
 
bool Intersects (FPBounds3 bounds)
 Returns true if there is an intersection between bounds. More...
 
void SetMinMax (FPVector3 min, FPVector3 max)
 Set the bounds to the given min and max points. More...
 

Static Public Member Functions

static unsafe void Serialize (void *ptr, IDeterministicFrameSerializer serializer)
 Serializes the FPBounds3 struct. More...
 

Public Attributes

FPVector3 Center
 Center of the bounding box. More...
 
FPVector3 Extents
 Extents of the bounding box (half of the size). More...
 

Static Public Attributes

const int SIZE = FPVector3.SIZE * 2
 /// More...
 

Properties

FPVector3 Max [get, set]
 Gets or sets the maximal point of the box. This is always equal to Center + Extents. Setting this property will not affect Min. More...
 
FPVector3 Min [get, set]
 Gets or sets the minimal point of the box. This is always equal to Center - Extents. Setting this property will not affect Max. More...
 

Detailed Description

Represents an 3D axis aligned bounding box (AABB).

Constructor & Destructor Documentation

◆ FPBounds3()

Photon.Deterministic.FPBounds3.FPBounds3 ( FPVector3  center,
FPVector3  extents 
)
inline

Create a new Bounds with the given center and extents.

Parameters
centerCenter point.
extentsExtents (half the size).

Member Function Documentation

◆ Expand() [1/2]

void Photon.Deterministic.FPBounds3.Expand ( FP  amount)
inline

Expand bounds by 0.5 * amount in both directions.

Parameters
amount

◆ Expand() [2/2]

void Photon.Deterministic.FPBounds3.Expand ( FPVector3  amount)
inline

Expand bounds by 0.5 * amount in both directions.

Parameters
amount

◆ SetMinMax()

void Photon.Deterministic.FPBounds3.SetMinMax ( FPVector3  min,
FPVector3  max 
)
inline

Set the bounds to the given min and max points.

Parameters
minMinimum position.
maxMaximum position.

◆ Encapsulate() [1/2]

void Photon.Deterministic.FPBounds3.Encapsulate ( FPVector3  point)
inline

Expand bounds to contain point (if needed).

Parameters
point

◆ Encapsulate() [2/2]

void Photon.Deterministic.FPBounds3.Encapsulate ( FPBounds3  bounds)
inline

Expand bounds to contain bounds (if needed).

Parameters
bounds

◆ Intersects()

bool Photon.Deterministic.FPBounds3.Intersects ( FPBounds3  bounds)
inline

Returns true if there is an intersection between bounds.

Parameters
bounds
Returns

◆ Serialize()

static unsafe void Photon.Deterministic.FPBounds3.Serialize ( void *  ptr,
IDeterministicFrameSerializer  serializer 
)
inlinestatic

Serializes the FPBounds3 struct.

Parameters
ptrPointer to the FPBounds3 struct to be serialized.
serializerThe serializer object used to serialize and deserialize components.

◆ GetHashCode()

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

Computes a hash code for the current instance of the FPBounds3 class.

The hash code is computed by combining the hash codes of the Center and Extents.

Returns
A 32-bit signed integer hash code.

Member Data Documentation

◆ SIZE

const int Photon.Deterministic.FPBounds3.SIZE = FPVector3.SIZE * 2
static

///

The size of the struct in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed.

◆ Center

FPVector3 Photon.Deterministic.FPBounds3.Center

Center of the bounding box.

◆ Extents

FPVector3 Photon.Deterministic.FPBounds3.Extents

Extents of the bounding box (half of the size).

Property Documentation

◆ Max

FPVector3 Photon.Deterministic.FPBounds3.Max
getset

Gets or sets the maximal point of the box. This is always equal to Center + Extents. Setting this property will not affect Min.

◆ Min

FPVector3 Photon.Deterministic.FPBounds3.Min
getset

Gets or sets the minimal point of the box. This is always equal to Center - Extents. Setting this property will not affect Max.