HatchitMath
Public Member Functions | List of all members
Hatchit::Math::Bounds Class Reference

Public Member Functions

 Bounds ()
 Constructors Creates a Bounds centered at 0,0,0 with all widths being 1.0f.
 
 Bounds (Vector3 center, float width)
 Creates a Bounds at the given center and given width across all axes. More...
 
 Bounds (Vector3 center, float xWidth, float yWidth, float zWidth)
 Creates a bounds at the given center with the given widths. More...
 
float getXWidth ()
 Returns the width along the X-axis. More...
 
float getYWidth ()
 Returns the width along the Y-axis. More...
 
float getZWidth ()
 Returns the width along the Z-axis. More...
 
Vector3 getCenter ()
 Returns the center point. More...
 
Vector3 getMinBound ()
 Returns corner of the Bounds along all the negative widths. More...
 
Vector3 getMaxBound ()
 Returns corner of the Bounds along all the positive widths. More...
 
Vector3 getPositive (Vector3 normal)
 Calculates and returns the furthest corner of the bounds along the given normal vector. More...
 
Vector3 getNegative (Vector3 normal)
 Calculates and returns the furthest corner of the bounds away from the given normal vector. More...
 
bool isCollidingWithBounds (Bounds other)
 Determines whether or not this Bounds collides with another Bounds. More...
 

Constructor & Destructor Documentation

Bounds::Bounds ( Vector3  center,
float  width 
)

Creates a Bounds at the given center and given width across all axes.

Parameters
centerThe Vector3 for this Bounds to be centered at
widthThe width of this Bounds
Bounds::Bounds ( Vector3  center,
float  xWidth,
float  yWidth,
float  zWidth 
)

Creates a bounds at the given center with the given widths.

Parameters
centerThe Vector3 for this Bounds to be centered at
xWidthThe width of this Bounds along the global X-axis
yWidthThe width of this Bounds along the global Y-axis
zWidthThe width of this Bounds along the global Z-axis

Member Function Documentation

Vector3 Bounds::getCenter ( )

Returns the center point.

Returns
The center as a Vector3
Vector3 Bounds::getMaxBound ( )

Returns corner of the Bounds along all the positive widths.

Returns
The maximum bound as a Vector3
Vector3 Bounds::getMinBound ( )

Returns corner of the Bounds along all the negative widths.

Returns
The minimum bound as a Vector3
Vector3 Bounds::getNegative ( Vector3  normal)

Calculates and returns the furthest corner of the bounds away from the given normal vector.

Parameters
normalThe normalized Vector3 that we want to get the corner from
Returns
The corner of the bounds furthest away from the given normal
Vector3 Bounds::getPositive ( Vector3  normal)

Calculates and returns the furthest corner of the bounds along the given normal vector.

Parameters
normalThe normalized Vector3 that we want to get the corner from
Returns
The corner of the bounds furthest along the given normal
float Bounds::getXWidth ( )

Returns the width along the X-axis.

Returns
The width of the Bounds along the X-axis
float Bounds::getYWidth ( )

Returns the width along the Y-axis.

Returns
The width of the Bounds along the Y-axis
float Bounds::getZWidth ( )

Returns the width along the Z-axis.

Returns
The width of the Bounds along the Z-axis
bool Bounds::isCollidingWithBounds ( Bounds  other)

Determines whether or not this Bounds collides with another Bounds.

Parameters
otherThe other Bounds to test against
Returns
True if this and the other Bounds intersect anywhere

The documentation for this class was generated from the following files: