Public Types | Public Member Functions | Public Attributes

rect3d_t Struct Reference

standard 3D axis-aligned rectangle (also called axis-aligned bounding box, AABB) More...

#include <geometry_3d.h>

List of all members.

Public Types

enum  eConstants {
  eMaxCorners = 8,
  eMaxEdges = 12
}

Public Member Functions

void clear (void) throw ()
void dump (const char *title) const throw ()
bool isValid (void) const throw ()
void validate (const char *msg=NULL) const throw ()
bool containsPoint (const point3d_t &p) const throw ()
bool intersectsRect (const rect3d_t &r) const throw ()
bool containsRect (const rect3d_t &r) const throw ()
void expand (const rect3d_t &r) throw ()
void inflate (float r) throw ()
void setToPoint (const point3d_t &p) throw ()
void includePoint (const point3d_t &p) throw ()
void getBoundingRectForSphere (const point3d_t &center, float radius) throw ()
point3d_t getMidpoint (void) const throw ()
float getDiagonal (void) const throw ()
void restrictPoint (point3d_t &p) const throw ()
 restricts the given point to be within the rectangle
point3d_t getCorner (int index) const throw ()
 given an index 0 <= index <= eMaxCorners, returns the corner point
void getEdge (int index, point3d_t &p0, point3d_t &p1) const throw ()
 given an index 0 <= index <= eMaxEdges, returns the two edge endpoints
void translate (const point3d_t &delta) throw ()

Public Attributes

float x0
float y0
float z0
float x1
float y1
float z1

Detailed Description

standard 3D axis-aligned rectangle (also called axis-aligned bounding box, AABB)

Definition at line 172 of file geometry_3d.h.


Member Enumeration Documentation

Enumerator:
eMaxCorners 
eMaxEdges 

Definition at line 174 of file geometry_3d.h.


Member Function Documentation

void rect3d_t::clear ( void   )  throw () [inline]

Definition at line 180 of file geometry_3d.h.

void rect3d_t::dump ( const char *  title  )  const throw () [inline]

Definition at line 184 of file geometry_3d.h.

bool rect3d_t::isValid ( void   )  const throw () [inline]

Definition at line 189 of file geometry_3d.h.

void rect3d_t::validate ( const char *  msg = NULL  )  const throw () [inline]

Definition at line 193 of file geometry_3d.h.

bool rect3d_t::containsPoint ( const point3d_t p  )  const throw () [inline]

Definition at line 200 of file geometry_3d.h.

bool rect3d_t::intersectsRect ( const rect3d_t r  )  const throw () [inline]

Definition at line 206 of file geometry_3d.h.

bool rect3d_t::containsRect ( const rect3d_t r  )  const throw () [inline]

Definition at line 217 of file geometry_3d.h.

void rect3d_t::expand ( const rect3d_t r  )  throw () [inline]

Definition at line 226 of file geometry_3d.h.

void rect3d_t::inflate ( float  r  )  throw () [inline]

Definition at line 244 of file geometry_3d.h.

void rect3d_t::setToPoint ( const point3d_t p  )  throw () [inline]

Definition at line 250 of file geometry_3d.h.

void rect3d_t::includePoint ( const point3d_t p  )  throw () [inline]

Definition at line 256 of file geometry_3d.h.

void rect3d_t::getBoundingRectForSphere ( const point3d_t center,
float  radius 
) throw () [inline]

Definition at line 271 of file geometry_3d.h.

point3d_t rect3d_t::getMidpoint ( void   )  const throw () [inline]

Definition at line 282 of file geometry_3d.h.

float rect3d_t::getDiagonal ( void   )  const throw () [inline]

Definition at line 288 of file geometry_3d.h.

void rect3d_t::restrictPoint ( point3d_t p  )  const throw () [inline]

restricts the given point to be within the rectangle

Definition at line 297 of file geometry_3d.h.

point3d_t rect3d_t::getCorner ( int  index  )  const throw ()

given an index 0 <= index <= eMaxCorners, returns the corner point

Definition at line 122 of file geometry_3d.cpp.

void rect3d_t::getEdge ( int  index,
point3d_t p0,
point3d_t p1 
) const throw ()

given an index 0 <= index <= eMaxEdges, returns the two edge endpoints

Definition at line 145 of file geometry_3d.cpp.

void rect3d_t::translate ( const point3d_t delta  )  throw () [inline]

Definition at line 322 of file geometry_3d.h.


Member Data Documentation

float rect3d_t::x0

Definition at line 332 of file geometry_3d.h.

float rect3d_t::y0

Definition at line 333 of file geometry_3d.h.

float rect3d_t::z0

Definition at line 334 of file geometry_3d.h.

float rect3d_t::x1

Definition at line 335 of file geometry_3d.h.

float rect3d_t::y1

Definition at line 336 of file geometry_3d.h.

float rect3d_t::z1

Definition at line 337 of file geometry_3d.h.


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