KS.Reactor.ksBounds Struct Reference

A struct that defines an axis aligned bounding box (AABB). More...

Inheritance diagram for KS.Reactor.ksBounds:

Public Member Functions

 ksBounds (ksVector3 min, ksVector3 max)
 Constructor. More...
 
bool Contains (ksVector3 point)
 Check if a point is contained by the bounds. More...
 
bool Contains (ksBounds bounds)
 Check if another set of bounds is contained by the bounds. More...
 
bool Intersects (ksBounds bounds)
 Check if another bounds intersects this bounds. More...
 
void Encapsulate (ksVector3 point)
 Expand the volume to include a point. More...
 
void Encapsulate (ksBounds bounds)
 Expand the volume to include another set of bounds. More...
 
bool Equals (ksBounds other)
 Check if this bounds is equal to another bounds. More...
 
override bool Equals (object obj)
 Check if this bounds is equal to an object. More...
 
override int GetHashCode ()
 Get the hash code for the bounds. More...
 
override string ToString ()
 Construct a string the describes the bounds. More...
 

Static Public Member Functions

static bool operator== (ksBounds lhs, ksBounds rhs)
 Check if two bounds are equal More...
 
static bool operator!= (ksBounds lhs, ksBounds rhs)
 Check if two bounds are not equal More...
 
static implicit operator Bounds (ksBounds value)
 Implicit conversion from ksBounds to Unity Bounds. More...
 
static implicit operator ksBounds (Bounds value)
 Implicit conversion from Unity Bounds to ksBounds. More...
 
static bool operator== (ksBounds lhs, Bounds rhs)
 Equality comparison between Reactor bounds and Unity bounds. More...
 
static bool operator== (Bounds lhs, ksBounds rhs)
 Equality comparison between Unity bounds and Reactor bounds. More...
 
static bool operator!= (ksBounds lhs, Bounds rhs)
 Inequality comparison between Reactor bounds and Unity bounds. More...
 
static bool operator!= (Bounds lhs, ksBounds rhs)
 Inequality comparison between Unity bounds and Reactor bounds. More...
 

Properties

ksVector3 Min [get, set]
 Get/Set the minimum coordinates contained by the bounds. More...
 
ksVector3 Max [get, set]
 Get the maxmimum coordinates contained by the bounds. More...
 
ksVector3 Size [get, set]
 Get/Set the size of the bounds. More...
 
ksVector3 Center [get, set]
 Get/Set the center of the bounds More...
 
bool IsEmpty [get]
 The bounds are empty if any of the size dimensions are less than or equal to 0. More...
 

Detailed Description

A struct that defines an axis aligned bounding box (AABB).

Constructor & Destructor Documentation

◆ ksBounds()

KS.Reactor.ksBounds.ksBounds ( ksVector3  min,
ksVector3  max 
)

Constructor.

Parameters
minMin value.
maxMax value.

Member Function Documentation

◆ Contains() [1/2]

bool KS.Reactor.ksBounds.Contains ( ksBounds  bounds)

Check if another set of bounds is contained by the bounds.

Parameters
boundsBounds to test.
Returns
True if the other bounds are contained.

◆ Contains() [2/2]

bool KS.Reactor.ksBounds.Contains ( ksVector3  point)

Check if a point is contained by the bounds.

Parameters
pointPoint to test.
Returns
True if the point is contained or on the edge of the bounds.

◆ Encapsulate() [1/2]

void KS.Reactor.ksBounds.Encapsulate ( ksBounds  bounds)

Expand the volume to include another set of bounds.

Parameters
boundsBounds to encapsulate.

◆ Encapsulate() [2/2]

void KS.Reactor.ksBounds.Encapsulate ( ksVector3  point)

Expand the volume to include a point.

Parameters
pointPoint to encapsulate.

◆ Equals() [1/2]

bool KS.Reactor.ksBounds.Equals ( ksBounds  other)

Check if this bounds is equal to another bounds.

Parameters
otherOther bounds to compare with this bounds.
Returns
True if the bounds have the same min and max values.

◆ Equals() [2/2]

override bool KS.Reactor.ksBounds.Equals ( object  obj)

Check if this bounds is equal to an object.

Parameters
objObject to compare with this bounds.
Returns
True if the object is a ksBounds and they have the same min and max values.

◆ GetHashCode()

override int KS.Reactor.ksBounds.GetHashCode ( )

Get the hash code for the bounds.

Returns

◆ Intersects()

bool KS.Reactor.ksBounds.Intersects ( ksBounds  bounds)

Check if another bounds intersects this bounds.

Parameters
boundsBounds to test against.
Returns
True if the bounds overlap.

◆ operator Bounds()

static implicit KS.Reactor.ksBounds.operator Bounds ( ksBounds  value)
static

Implicit conversion from ksBounds to Unity Bounds.

Parameters
valueReactor bounds to convert to Unity bounds.

◆ operator ksBounds()

static implicit KS.Reactor.ksBounds.operator ksBounds ( Bounds  value)
static

Implicit conversion from Unity Bounds to ksBounds.

Parameters
valueUnity bounds to convert to Reactor bounds

◆ operator!=() [1/3]

static bool KS.Reactor.ksBounds.operator!= ( Bounds  lhs,
ksBounds  rhs 
)
static

Inequality comparison between Unity bounds and Reactor bounds.

Parameters
lhsUnity bounds
rhsReactor bounds
Returns
True if the bounds are not equal.

◆ operator!=() [2/3]

static bool KS.Reactor.ksBounds.operator!= ( ksBounds  lhs,
Bounds  rhs 
)
static

Inequality comparison between Reactor bounds and Unity bounds.

Parameters
lhsReactor bounds
rhsUnity bounds
Returns
True if the bounds are not equal.

◆ operator!=() [3/3]

static bool KS.Reactor.ksBounds.operator!= ( ksBounds  lhs,
ksBounds  rhs 
)
static

Check if two bounds are not equal

Parameters
lhs
rhs
Returns
True if the bounds have different min or max values.

◆ operator==() [1/3]

static bool KS.Reactor.ksBounds.operator== ( Bounds  lhs,
ksBounds  rhs 
)
static

Equality comparison between Unity bounds and Reactor bounds.

Parameters
lhsUnity bounds
rhsReactor bounds
Returns
True if the bounds are equal.

◆ operator==() [2/3]

static bool KS.Reactor.ksBounds.operator== ( ksBounds  lhs,
Bounds  rhs 
)
static

Equality comparison between Reactor bounds and Unity bounds.

Parameters
lhsReactor bounds
rhsUnity bounds
Returns
True if the bounds are equal.

◆ operator==() [3/3]

static bool KS.Reactor.ksBounds.operator== ( ksBounds  lhs,
ksBounds  rhs 
)
static

Check if two bounds are equal

Parameters
lhs
rhs
Returns
True if the bounds have the same min and max values.

◆ ToString()

override string KS.Reactor.ksBounds.ToString ( )

Construct a string the describes the bounds.

Returns
String describing the min and max coordinates of the bounds.

Property Documentation

◆ Center

ksVector3 KS.Reactor.ksBounds.Center
getset

Get/Set the center of the bounds

◆ IsEmpty

bool KS.Reactor.ksBounds.IsEmpty
get

The bounds are empty if any of the size dimensions are less than or equal to 0.

◆ Max

ksVector3 KS.Reactor.ksBounds.Max
getset

Get the maxmimum coordinates contained by the bounds.

The min value of the bounds will extend to accomodate the new max value when it is contains smaller values than the current min values.

◆ Min

ksVector3 KS.Reactor.ksBounds.Min
getset

Get/Set the minimum coordinates contained by the bounds.

The max value of the bounds will extend to accomodate the new min value when it contains larger values than the current max values.

◆ Size

ksVector3 KS.Reactor.ksBounds.Size
getset

Get/Set the size of the bounds.

The new size will recalculate the min and max values from the existing bounds center.