Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Collision Class Reference

#include <collision.h>

Collaboration diagram for Collision:

Collaboration graph
[legend]
List of all members.

Public Methods

 Collision ()
 Default and unusefull default constructor.

 Collision (Cylinder *cyl1, const Point3d &pt1, Cylinder *cyl2, const Point3d &pt2, Vector3d &normal, collisionType type)
 Collision against other cylinder.

 Collision (Cylinder *cyl, const Point3d &pt, collisionType type)
 Collision (Cylinder *cyl, const Point3d &pt1, const Point3d &pt2, collisionType type)
 Collision of one cylinder in two points over a plane.

 ~Collision ()
void resolve ()
 Resolves the collision appling a force on the cylinders.

collisionType getType ()
 Returns the type of collision.


Protected Methods

void resolveGroundCollision ()
 Resolves the collision against ground plane.

void resolveCylinderCollision ()
 Resolves the collision against another cylinder.


Protected Attributes

Cylindercyl1
 Cylinder that collides.

Cylindercyl2
 Cylinder that collides.

Point3d pt1
 Point over cylinder.

Point3d pt2
 Point over cylinder.

collisionType type
 Type of collision.

Vector3d normal
 Collision normal, normalized.


Constructor & Destructor Documentation

Collision::Collision  
 

Default and unusefull default constructor.

Default constructor, but not usefull at all.

Definition at line 34 of file collision.cc.

References noCollision, and type.

Collision::Collision Cylinder   _cyl1,
const Point3d &    _pt1,
Cylinder   _cyl2,
const Point3d &    _pt2,
Vector3d   _normal,
collisionType    _type
 

Collision against other cylinder.

This collision is against another cylinder. Just copy some data.

Definition at line 42 of file collision.cc.

References collisionType, cyl1, cyl2, normal, Point3d, pt1, pt2, and type.

Collision::Collision Cylinder   cyl,
const Point3d &    pt,
collisionType    type
 

Collision between a plane and a cylinder. The plane is always the ground plane (n(0,0,1), p(0,1,0)).

Definition at line 55 of file collision.cc.

References collisionType, cyl1, cyl2, normal, Point3d, pt1, and type.

Collision::Collision Cylinder   _cyl,
const Point3d &    _pt1,
const Point3d &    _pt2,
collisionType    _type
 

Collision of one cylinder in two points over a plane.

Two points of one cylinder are touching in some way a plane, the only difference is that we should anulate moment

Definition at line 67 of file collision.cc.

References collisionType, cyl1, cyl2, normal, Point3d, pt1, pt2, and type.

Collision::~Collision  
 

Definition at line 78 of file collision.cc.


Member Function Documentation

collisionType Collision::getType   [inline]
 

Returns the type of collision.

Definition at line 76 of file collision.h.

References collisionType, and type.

Referenced by Cylinder::newCycle().

void Collision::resolve  
 

Resolves the collision appling a force on the cylinders.

Resolves a collision

Definition at line 84 of file collision.cc.

References cyl2, noCollision, resolveCylinderCollision(), resolveGroundCollision(), and type.

Referenced by Cylinder::newCycle().

void Collision::resolveCylinderCollision   [protected]
 

Resolves the collision against another cylinder.

Resolves the forces that have to applied against both cylinders, the moments, and all those things, depending if they are in contact, o penetrating...

Definition at line 171 of file collision.cc.

Referenced by resolve().

void Collision::resolveGroundCollision   [protected]
 

Resolves the collision against ground plane.

Definition at line 94 of file collision.cc.

References Cylinder::angularVelocity, COLLISION_VELOCITY_EPSILUM, contact, cyl1, Cylinder::force, World::getGroundFrictionCoefficient(), Cylinder::inertia, Cylinder::inertiaInverse, log, Cylinder::mass, Vector3d::module(), Cylinder::moment, normal, Vector3d::normalize(), Cylinder::orientationBase, Point3d, pt1, Quaternion::toBody(), Vector3d::toString(), Quaternion::toWorld(), type, Cylinder::velocity, Vector3d::X(), Vector3d::Y(), and Vector3d::Z().

Referenced by resolve().


Member Data Documentation

Cylinder* Collision::cyl1 [protected]
 

Cylinder that collides.

Definition at line 43 of file collision.h.

Referenced by Collision(), and resolveGroundCollision().

Cylinder * Collision::cyl2 [protected]
 

Cylinder that collides.

Definition at line 43 of file collision.h.

Referenced by Collision(), and resolve().

Vector3d Collision::normal [protected]
 

Collision normal, normalized.

Definition at line 50 of file collision.h.

Referenced by Collision(), and resolveGroundCollision().

Point3d Collision::pt1 [protected]
 

Point over cylinder.

Definition at line 45 of file collision.h.

Referenced by Collision(), and resolveGroundCollision().

Point3d Collision::pt2 [protected]
 

Point over cylinder.

Definition at line 45 of file collision.h.

Referenced by Collision().

collisionType Collision::type [protected]
 

Type of collision.

Definition at line 48 of file collision.h.

Referenced by Collision(), getType(), resolve(), and resolveGroundCollision().


The documentation for this class was generated from the following files:
Generated on Mon Jun 17 19:54:15 2002 for Svas Server by doxygen1.2.16