CollisionObject Class Reference
#include <CollisionObject.h>
Inherited by CollisionCircle, and CollisionLineSet.

Public Member Functions | |
| CollisionObject () | |
| virtual | ~CollisionObject () |
| std::vector< CollisionData * > & | checkCollision (CollisionObject *opponent, std::vector< CollisionData * > &dst) |
| virtual void | setTransformation (TransformationData trans) |
| virtual TransformationData & | getTransformation () |
| virtual std::string | getType ()=0 |
Protected Member Functions | |
| virtual bool | canCheckCollision (CollisionObject *opponent)=0 |
| virtual std::vector < CollisionData * > & | checkCollisionInternal (CollisionObject *opponent, std::vector< CollisionData * > &dst, bool changeOrder)=0 |
Protected Attributes | |
| TransformationData | transformation |
| The Transformation of the CollisionObject. | |
Constructor & Destructor Documentation
| CollisionObject::CollisionObject | ( | ) |
Constructor initializes transformation of CollisionObject.
| CollisionObject::~CollisionObject | ( | ) | [virtual] |
Empty destructor.
Member Function Documentation
| virtual bool CollisionObject::canCheckCollision | ( | CollisionObject * | opponent | ) | [protected, pure virtual] |
Checks if a collision-method is implemented for a collision check between the current CollisionObject and the passed one. Internally it checks the name of the passed CollisionObject and returns if a method exists locally to check for collisions.
- Parameters:
-
opponent CollisionObject for which a collision-method is searched
- Returns:
- true if a collision-method is implemented in this class, false otherwise
Implemented in CollisionCircle, and CollisionLineSet.
| std::vector< CollisionData * > & CollisionObject::checkCollision | ( | CollisionObject * | opponent, | |
| std::vector< CollisionData * > & | dst | |||
| ) |
Checks if the Object collides with another CollisionObject. The method checks if it collides with the passed CollisionObject. It gets a reference to a vector of CollisionData elements as parameter where it stores the calculated collision information if one ore more collision points are found.
- Parameters:
-
opponent CollisionObject with which a collision should be checked dst Destination vector where all Collisions are stored to
- Returns:
- Destination vector (same as second parameter)
| virtual std::vector<CollisionData*>& CollisionObject::checkCollisionInternal | ( | CollisionObject * | opponent, | |
| std::vector< CollisionData * > & | dst, | |||
| bool | changeOrder | |||
| ) | [protected, pure virtual] |
Calculates the collisions between the passed CollisionObject and itself. This method is called internally to calculate the collisions between the passed Object and the current Object. For each contact point found a own CollisionData-entry is placed into the passed destination vector. The parameter changeOrder defines in which order the CollisionObjects are stored in the CollisionData elements. The CollisionObject on which the checkCollision method is called is always the first CollisionObject in the CollisionData element.
- Parameters:
-
opponent CollisionObject to check the collision with dst Destination vector where to write the collision information to changeOrder Defines order of CollisionObjects in CollisionData
- Returns:
- Destination vector (same as second parameter)
Implemented in CollisionCircle, and CollisionLineSet.
| TransformationData & CollisionObject::getTransformation | ( | ) | [virtual] |
Returns the Transformation of the CollisionObject. The method returns a the TransformationData of the Object. This Transformation can be used by the checkCollision methods to determine if one CollisionObject collides with another one.
- Returns:
- Transformation of CollisionObject
| virtual std::string CollisionObject::getType | ( | ) | [pure virtual] |
Returns the name of the CollisionObject. The method returns the name of the CollisionObject. This name is normally equal to the classname of the CollisionObject. It is used in the checkCollision methods to identify the type of CollisionObject and to find the correct method for the collision test between two objects.
- Returns:
- Type (=name) of the CollisionObject.
Implemented in CollisionCircle, and CollisionLineSet.
| void CollisionObject::setTransformation | ( | TransformationData | trans | ) | [virtual] |
Sets the Transformation of the CollisionObject. The method sets the Transformation of the Object. This Transformation will be used boy the checkCollision methods to determine if one CollisionObject collides with another one.
- Parameters:
-
trans Transformation of the CollisionObject
Member Data Documentation
TransformationData CollisionObject::transformation [protected] |
The Transformation of the CollisionObject.
The documentation for this class was generated from the following files:
- tools/libraries/CollisionMap/CollisionObject.h
- tools/libraries/CollisionMap/CollisionObject.cpp
Generated on Wed Oct 20 16:11:55 2010 for inVRs by
1.5.8