Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ParticleSystems::CollisionRectangle Class Reference

The CollisionRectangle Class. More...

#include <CollisionRectangle.h>

Inheritance diagram for ParticleSystems::CollisionRectangle:

ParticleSystems::CollisionObject List of all members.

Public Member Functions

 CollisionRectangle (GraphicsLib::Point3 *c1, GraphicsLib::Point3 *c2, GraphicsLib::Point3 *c3, GraphicsLib::Point3 *c4)
 The Constructor.
virtual ~CollisionRectangle ()
 The destructor.
virtual void collide (Particle *p)
 A virtual function.
virtual void draw ()
 A virtual function.
virtual void translate ()
 A virtual function.
virtual void rotate ()
 A virtual function.
virtual void scale ()
 A virtual function.
GraphicsLib::Real getDistance (GraphicsLib::Vector *v, GraphicsLib::Point3 *p)
 A member function.
void calcCenter ()
 A member function.
void calculateNormal ()
 A member function.
GraphicsLib::Real BBheight ()
 A member function.
GraphicsLib::Real BBwidth ()
 A member function.
GraphicsLib::Real BBdepth ()
 A member function.
float max (float a, float b)
 A member Function.
float min (float a, float b)
 A member Function.

Public Attributes

GraphicsLib::Point3 corner1
 A public variable.
GraphicsLib::Point3 corner2
 A public variable.
GraphicsLib::Point3 corner3
 A public variable.
GraphicsLib::Point3 corner4
 A public variable.
GraphicsLib::Point3 center
 A public variable.
GraphicsLib::Vector normal
 A public variable.

Detailed Description

The CollisionRectangle Class.

A class to create a plane which can be used to make Particles collide against. This Class extends the CollisionObject

Author:
Hannes Ricklefs

Definition at line 36 of file CollisionRectangle.h.


Constructor & Destructor Documentation

CollisionRectangle::CollisionRectangle GraphicsLib::Point3 *  c1,
GraphicsLib::Point3 *  c2,
GraphicsLib::Point3 *  c3,
GraphicsLib::Point3 *  c4
 

The Constructor.

Constructs a new CollisionRectangle by passing the four corner points. Need to be in clockwise order!

Parameters:
c1 a pointer to a corner of the CollisionRectangle
c2 a pointer to a corner of the CollisionRectangle
c3 a pointer to a corner of the CollisionRectangle
c4 a pointer to a corner of the CollisionRectangle

Definition at line 11 of file CollisionRectangle.cpp.

References center, corner1, corner2, corner3, corner4, and normal.

CollisionRectangle::~CollisionRectangle  )  [virtual]
 

The destructor.

The Destructor of this CollisionRectangle

Definition at line 27 of file CollisionRectangle.cpp.


Member Function Documentation

float CollisionRectangle::BBdepth  ) 
 

A member function.

Calculate the depth of the bounding box for this Rectangle

Definition at line 146 of file CollisionRectangle.cpp.

References corner1, corner2, corner3, corner4, max(), and min().

Referenced by collide().

float CollisionRectangle::BBheight  ) 
 

A member function.

Calculate the height of the bounding box for this Rectangle

Definition at line 128 of file CollisionRectangle.cpp.

References corner1, corner2, corner3, corner4, max(), and min().

Referenced by collide().

float CollisionRectangle::BBwidth  ) 
 

A member function.

Calculate the width of the bounding box for this Rectangle

Definition at line 137 of file CollisionRectangle.cpp.

References corner1, corner2, corner3, corner4, max(), and min().

Referenced by collide().

void CollisionRectangle::calcCenter  ) 
 

A member function.

Calculates the center of this Rectangle and stores the result in the center point.

Definition at line 85 of file CollisionRectangle.cpp.

References center, corner1, and corner3.

void ParticleSystems::CollisionRectangle::calculateNormal  ) 
 

A member function.

Calculates the normal of this CollisionRectangle and stores the result in the normal vector.

void CollisionRectangle::collide Particle p  )  [virtual]
 

A virtual function.

Checks if a collision occured between the passed Particle and this CollisionRectangle

Parameters:
p a pointer to the Particle

Implements ParticleSystems::CollisionObject.

Definition at line 30 of file CollisionRectangle.cpp.

References BBdepth(), BBheight(), BBwidth(), getDistance(), and normal.

void CollisionRectangle::draw  )  [virtual]
 

A virtual function.

Draws this CollisionRectangle

Implements ParticleSystems::CollisionObject.

Definition at line 118 of file CollisionRectangle.cpp.

References corner1, corner2, corner3, and corner4.

Real CollisionRectangle::getDistance GraphicsLib::Vector *  v,
GraphicsLib::Point3 *  p
 

A member function.

Returns the distance between the given vector and the point

Parameters:
v the pointer to the vector
p the pointer to the point

Definition at line 114 of file CollisionRectangle.cpp.

Referenced by collide().

float CollisionRectangle::max float  a,
float  b
 

A member Function.

The maximum of two Real numbers

Parameters:
a the first test
b the second test
Returns:
the max of the two

Definition at line 154 of file CollisionRectangle.cpp.

Referenced by BBdepth(), BBheight(), and BBwidth().

float CollisionRectangle::min float  a,
float  b
 

A member Function.

The minimum of two Real numbers

Parameters:
a the first test
b the second test
Returns:
the min of the two

Definition at line 162 of file CollisionRectangle.cpp.

Referenced by BBdepth(), BBheight(), and BBwidth().

void CollisionRectangle::rotate  )  [virtual]
 

A virtual function.

Translates this CollisionRectangle

Implements ParticleSystems::CollisionObject.

Definition at line 171 of file CollisionRectangle.cpp.

void CollisionRectangle::scale  )  [virtual]
 

A virtual function.

Translates this CollisionSphere

Implements ParticleSystems::CollisionObject.

Definition at line 172 of file CollisionRectangle.cpp.

void CollisionRectangle::translate  )  [virtual]
 

A virtual function.

Translates this CollisionRectangle

Implements ParticleSystems::CollisionObject.

Definition at line 170 of file CollisionRectangle.cpp.


Member Data Documentation

GraphicsLib::Point3 ParticleSystems::CollisionRectangle::center
 

A public variable.

The Center of the CollisionRectangle

Definition at line 172 of file CollisionRectangle.h.

Referenced by calcCenter(), and CollisionRectangle().

GraphicsLib::Point3 ParticleSystems::CollisionRectangle::corner1
 

A public variable.

Corner1 of the CollisionRectangle

Definition at line 148 of file CollisionRectangle.h.

Referenced by BBdepth(), BBheight(), BBwidth(), calcCenter(), CollisionRectangle(), and draw().

GraphicsLib::Point3 ParticleSystems::CollisionRectangle::corner2
 

A public variable.

Corner2 of the CollisionRectangle

Definition at line 154 of file CollisionRectangle.h.

Referenced by BBdepth(), BBheight(), BBwidth(), CollisionRectangle(), and draw().

GraphicsLib::Point3 ParticleSystems::CollisionRectangle::corner3
 

A public variable.

Corner3 of the CollisionRectangle

Definition at line 160 of file CollisionRectangle.h.

Referenced by BBdepth(), BBheight(), BBwidth(), calcCenter(), CollisionRectangle(), and draw().

GraphicsLib::Point3 ParticleSystems::CollisionRectangle::corner4
 

A public variable.

Corner4 of the CollisionRectangle

Definition at line 166 of file CollisionRectangle.h.

Referenced by BBdepth(), BBheight(), BBwidth(), CollisionRectangle(), and draw().

GraphicsLib::Vector ParticleSystems::CollisionRectangle::normal
 

A public variable.

The normal of the CollisionRectangle

Definition at line 178 of file CollisionRectangle.h.

Referenced by collide(), and CollisionRectangle().


The documentation for this class was generated from the following files:
Generated on Thu Mar 24 11:05:02 2005 for ParticleSystem by  doxygen 1.4.1