Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

Nytro::Math::Box Class Reference

An axis aligned 3D box. More...

#include <nyBox.h>

Inheritance diagram for Nytro::Math::Box:
Inheritance graph
[legend]

Public Types

enum  EBoxClipFlag {
  eBoxClipFlag_Outside = 0, eBoxClipFlag_IsEqual = NYTRO_BIT(0), eBoxClipFlag_IsContained = NYTRO_BIT(1), eBoxClipFlag_Contains = NYTRO_BIT(2),
  eBoxClipFlag_Clips = NYTRO_BIT(3)
}
 

clipping flags when queried for intersection between two boxes

More...

Public Member Functions

 Box ()
 Box (Box &rBox)
Boxoperator= (Box &rOriginal)
 ~Box ()
void set (Vector3D &rMin, Vector3D &rMax)
 set the box min and max corners
void setMin (Vector3D &rValue)
 set the min corner
void setMax (Vector3D &rValue)
 set the max corner
Vector3DgetMin ()
Vector3DgetMax ()
float32 getWidth ()
float32 getHeight ()
float32 getDepth ()
Vector3D getCenter ()
void startBoundingBox ()
 start computing a bounding box by setting the min/max corners to a small value
void getCorners (Vector3D *pCorners)
 gets the corners as an array of 8 (eight) 3D vectors
void addPoint (Vector3D &rValue)
 add a point to the bounding box, enlarging it if required
void addPoints (Vector3D *pArray, uint32 aCount)
 add more points at once to the bounding box, enlarging it if required
void addBox (Box &rValue)
 add a box to this box, enlarging it if required
EBoxClipFlag intersect (Box &rValue)
 intersect a box with this one returning a clip flag result
bool intersect (Ray &rLine, Vector3D &rPoint, Vector3D &rNormal, float &rT)
 intersect a ray/line with the box
bool isPointInBox (Vector3D &rPoint)
 returns true if the rPoint is inside the box
Box operator* (float32 aValue)
Box operator+ (float32 aValue)
Box operator- (float32 aValue)
Box operator/ (float32 aValue)
Box operator* (Vector3D &aValue)
Box operator+ (Vector3D &aValue)
Box operator- (Vector3D &aValue)
Box operator/ (Vector3D &aValue)
Boxoperator*= (float32 aValue)
Boxoperator+= (float32 aValue)
Boxoperator-= (float32 aValue)
Boxoperator/= (float32 aValue)
Boxoperator*= (Vector3D &aValue)
Boxoperator+= (Vector3D &aValue)
Boxoperator-= (Vector3D &aValue)
Boxoperator/= (Vector3D &aValue)

Protected Member Functions

int32 getLineTest (float32 aV0, float32 aV1, float32 aW0, float32 aW1)

Protected Attributes

Vector3D m_min
Vector3D m_max

Detailed Description

An axis aligned 3D box.

Definition at line 20 of file nyBox.h.


Member Enumeration Documentation

clipping flags when queried for intersection between two boxes

Enumerator:
eBoxClipFlag_Outside 
eBoxClipFlag_IsEqual 
eBoxClipFlag_IsContained 
eBoxClipFlag_Contains 
eBoxClipFlag_Clips 

Definition at line 25 of file nyBox.h.


Constructor & Destructor Documentation

Nytro::Math::Box::Box (  ) 
Nytro::Math::Box::Box ( Box rBox  ) 
Nytro::Math::Box::~Box (  ) 

Member Function Documentation

void Nytro::Math::Box::addBox ( Box rValue  ) 

add a box to this box, enlarging it if required

void Nytro::Math::Box::addPoint ( Vector3D rValue  ) 

add a point to the bounding box, enlarging it if required

void Nytro::Math::Box::addPoints ( Vector3D pArray,
uint32  aCount 
)

add more points at once to the bounding box, enlarging it if required

Vector3D Nytro::Math::Box::getCenter (  ) 
Returns:
the box center
void Nytro::Math::Box::getCorners ( Vector3D pCorners  ) 

gets the corners as an array of 8 (eight) 3D vectors

float32 Nytro::Math::Box::getDepth (  ) 
Returns:
the box depth
float32 Nytro::Math::Box::getHeight (  ) 
Returns:
the box height
int32 Nytro::Math::Box::getLineTest ( float32  aV0,
float32  aV1,
float32  aW0,
float32  aW1 
) [protected]
Vector3D& Nytro::Math::Box::getMax (  ) 
Returns:
the max corner
Vector3D& Nytro::Math::Box::getMin (  ) 
Returns:
the min corner
float32 Nytro::Math::Box::getWidth (  ) 
Returns:
the box width
EBoxClipFlag Nytro::Math::Box::intersect ( Box rValue  ) 

intersect a box with this one returning a clip flag result

bool Nytro::Math::Box::intersect ( Ray rLine,
Vector3D rPoint,
Vector3D rNormal,
float &  rT 
)

intersect a ray/line with the box

Parameters:
rLine the line
rPoint the returned intersection point
rNormal the normal at the intersection point
rT the time (normalized [0..1]) across the line at the point of intersection
Returns:
true if line intersected the box
bool Nytro::Math::Box::isPointInBox ( Vector3D rPoint  ) 

returns true if the rPoint is inside the box

Box Nytro::Math::Box::operator* ( float32  aValue  ) 
Box Nytro::Math::Box::operator* ( Vector3D aValue  ) 
Box& Nytro::Math::Box::operator*= ( Vector3D aValue  ) 
Box& Nytro::Math::Box::operator*= ( float32  aValue  ) 
Box Nytro::Math::Box::operator+ ( float32  aValue  ) 
Box Nytro::Math::Box::operator+ ( Vector3D aValue  ) 
Box& Nytro::Math::Box::operator+= ( Vector3D aValue  ) 
Box& Nytro::Math::Box::operator+= ( float32  aValue  ) 
Box Nytro::Math::Box::operator- ( Vector3D aValue  ) 
Box Nytro::Math::Box::operator- ( float32  aValue  ) 
Box& Nytro::Math::Box::operator-= ( float32  aValue  ) 
Box& Nytro::Math::Box::operator-= ( Vector3D aValue  ) 
Box Nytro::Math::Box::operator/ ( float32  aValue  ) 
Box Nytro::Math::Box::operator/ ( Vector3D aValue  ) 
Box& Nytro::Math::Box::operator/= ( float32  aValue  ) 
Box& Nytro::Math::Box::operator/= ( Vector3D aValue  ) 
Box& Nytro::Math::Box::operator= ( Box rOriginal  ) 
void Nytro::Math::Box::set ( Vector3D rMin,
Vector3D rMax 
)

set the box min and max corners

void Nytro::Math::Box::setMax ( Vector3D rValue  ) 

set the max corner

void Nytro::Math::Box::setMin ( Vector3D rValue  ) 

set the min corner

void Nytro::Math::Box::startBoundingBox (  ) 

start computing a bounding box by setting the min/max corners to a small value


Field Documentation

Definition at line 100 of file nyBox.h.

Definition at line 100 of file nyBox.h.


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

© Copyright 7thFACTOR Entertainment - All rights reserved