In file graphics3D/BoxCollision.h:

namespace yav class BoxCollision

a class that is used to detect collision between a box and an geometrical object described by an OpenGL display List

Inheritance:


Public Methods

bool detectCollisionWithBox (Vec3 p1, Vec3 p2, double r1, Vec3 p3 = Vec3(1, 0, 0), double r2=-1)
detect collision with a 3D box : reset and update collisionList by storing the tags corresponding to the intersection OpenGL primitives
bool detectCollisionWithTriangle (Vec3 org, Vec3 dest, Vec3 up, double base, double width)
detect collision with a 3D triangle : reset and update collisionList by storing the tags corresponding to the intersection OpenGL primitives
void callCollisionDisplayList (void)
call (and build if needed) object's collision display list
std::list ::iterator getFirstCollision ()
return the first item of the collision list
std::list ::iterator getLastCollision ()
return the last item of the collision list
virtual void updateCollisionList ()
update the collision list of the geometry has been modified */
void destroyCollisionDisplayList ()
delete collision display list
bool getUseCollisionDisplayList ()
get the use of display list for collision detection
void setUseCollisionDisplayList (bool ucdl)
set useCollisionDisplayList's value

Public

constructor
BoxCollision ()
builds a BoxCollision object
destructor

Protected Fields

GLuint collisionDisplayList
the display list that is called to detect collision
static const unsigned int bufferSize
the maximum buffer size
GLuint selectionBuffer [bufferSize]
the selection buffer
std::list collisionList
the list of tags corresponding to each collision

Documentation

a class that is used to detect collision between a box and an geometrical object described by an OpenGL display List. This display list must include tags through pushName()/popName() commands
GLuint collisionDisplayList
the display list that is called to detect collision

static const unsigned int bufferSize
the maximum buffer size

GLuint selectionBuffer[bufferSize]
the selection buffer

std::list collisionList
the list of tags corresponding to each collision

constructor

BoxCollision()
builds a BoxCollision object

destructor

bool detectCollisionWithBox(Vec3 p1, Vec3 p2, double r1, Vec3 p3 = Vec3(1, 0, 0), double r2=-1)
detect collision with a 3D box : reset and update collisionList by storing the tags corresponding to the intersection OpenGL primitives
Returns:
a boolean that is true if there were a collision
Parameters:
p1 - the first point of box's axis
p2 - the second point of box's axis
r1 - the square width
p3 - the up direction (optional = 1,0,0)
r2 - the square lenght in p3 direction (optional = r1)

bool detectCollisionWithTriangle(Vec3 org, Vec3 dest, Vec3 up, double base, double width)
detect collision with a 3D triangle : reset and update collisionList by storing the tags corresponding to the intersection OpenGL primitives
Returns:
a boolean that is true if there were a collision
Parameters:
org - the top of triangle
dest - the middle of triangle's base
up - the width direction
base - the triangle's base length
width - the triangle's width

void callCollisionDisplayList(void)
call (and build if needed) object's collision display list

std::list ::iterator getFirstCollision()
return the first item of the collision list

std::list ::iterator getLastCollision()
return the last item of the collision list

virtual void updateCollisionList()
update the collision list of the geometry has been modified */

void destroyCollisionDisplayList()
delete collision display list

bool getUseCollisionDisplayList()
get the use of display list for collision detection

void setUseCollisionDisplayList(bool ucdl)
set useCollisionDisplayList's value


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de