#include <colmodel.h>
Collaboration diagram for CollisionModel:

Public Member Functions | |
| CollisionModel () | |
| virtual | ~CollisionModel () |
| bool | checkCollision (const CollisionModel &model) |
| Checks if this model collides with another. | |
| const GLVector3d & | getAvoidVector () |
| get mAvoidVector | |
| bool | computeMinimalAvoidVector (const CollisionModel &model, GLVector3d &result) |
| Compute minimal vector that avoids collision with second model. | |
| double | computeMinimalAvoidDistance (const CollisionModel &model, GLVector3d &direction) |
| Compute scale of direction vector so that translation will avoid collision with second model. | |
| void | setTranslation (const GLVector3d &translation) |
| Sets the translation ( to the world coordinates ) of the model. | |
| void | addTranslation (const GLVector3d &translation) |
| Add the relative ranslation ( to the world coordinates ) of the model. | |
| void | setRotation (const GLQuaterniond &rotation) |
| Sets the rotation (in the models coordinations) of the model. | |
| void | addRotation (const GLQuaterniond &rotation) |
| Add the rotation (in the models coordinations) of the model. | |
| void | finishTransformations () |
| Finishes trasnsformations and computes final coordinates of model. | |
| void | resetTransformations () |
| Resets the transformations set by setTranslation() and setRotation(). | |
| bool | isReseted () const |
| Tells whether model is ready for applying transformations. | |
| CDBox & | getModel () |
| Returns reference to the non-transformed model. | |
| CDBox & | getTransModel () |
| Returns reference to the transformed model. | |
| void | setModel (const CDBox &model) |
| Sets the model to the given box. | |
Private Attributes | |
| CDBox | mBox |
| Default object box, the origin should be in center of object ( CommonEntity::mPosition respresents this point ). | |
| CDBox | mTransBox |
| Box with applyied transformations. | |
| bool | mReseted |
| True, if model is ready for applying new transformations. | |
| GLVector3d | mTranslation |
| Vector, that stores translations. | |
| GLQuaterniond | mRotation |
| Vector, that stores rotations. | |
| GLVector3d | mAvoidVector |
| Stores result of colision detection. | |
Description of algorithm for detectiong colision between two CollisionModels. The idea is firstly to use min max test - CDBox::quickCheckCollision and then the algorihm try to find sepparating axis.
Definition at line 241 of file colmodel.h.
|
|
Definition at line 13 of file colmodel.cpp. References mAvoidVector, mBox, mReseted, mRotation, mTransBox, mTranslation, ZERO_ROTATION_VECTOR, and CDBox::zeroize(). Here is the call graph for this function: ![]() |
|
|
Definition at line 245 of file colmodel.h. |
|
|
Add the rotation (in the models coordinations) of the model.
Definition at line 328 of file colmodel.h. |
|
|
Add the relative ranslation ( to the world coordinates ) of the model. This may be used for incremental change of translation.
Definition at line 308 of file colmodel.h. |
|
|
Checks if this model collides with another. Checks if this model collides with another. If this is true, you can get vector to avoid colision by calling getAvoidVector()
Definition at line 254 of file colmodel.h. |
|
||||||||||||
|
Compute scale of direction vector so that translation will avoid collision with second model. Scale of direction vector and its length to avoid second model.
Definition at line 169 of file colmodel.cpp. References mTransBox, CDBox::quickCheckCollision(), SEP_TESTMAX, SEPSELF_MINUSTESTMAX, and SEPSELF_TESTMAX. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Compute minimal vector that avoids collision with second model. Compute minimum vector and its length to avoid second model.
Definition at line 44 of file colmodel.cpp. References mTransBox, CDBox::quickCheckCollision(), SEP_TEST, SEPSELF_MINUSTEST, and SEPSELF_TEST. Here is the call graph for this function: ![]() |
|
|
Finishes trasnsformations and computes final coordinates of model. Call this everytime you change translation, rotation or model. Else the collisions won't return correct results. Definition at line 338 of file colmodel.h. Referenced by CommonEntity::tranformColModel(). |
|
|
get mAvoidVector The vector is (may be) computed in checkCollision call
Definition at line 265 of file colmodel.h. |
|
|
Returns reference to the non-transformed model.
Definition at line 371 of file colmodel.h. Referenced by Tank::render(). |
|
|
Returns reference to the transformed model.
Definition at line 380 of file colmodel.h. Referenced by TaskSimulationServer::checkTerrainHeights(). |
|
|
Tells whether model is ready for applying transformations.
Definition at line 360 of file colmodel.h. |
|
|
Resets the transformations set by setTranslation() and setRotation().
Definition at line 349 of file colmodel.h. Referenced by CommonEntity::tranformColModel(). |
|
|
Sets the model to the given box.
Definition at line 389 of file colmodel.h. |
|
|
Sets the rotation (in the models coordinations) of the model.
Definition at line 318 of file colmodel.h. Referenced by CommonEntity::tranformColModel(). |
|
|
Sets the translation ( to the world coordinates ) of the model. The old translation is deleted.
Definition at line 297 of file colmodel.h. Referenced by CommonEntity::tranformColModel(). |
|
|
Stores result of colision detection.
Definition at line 406 of file colmodel.h. Referenced by CollisionModel(). |
|
|
Default object box, the origin should be in center of object ( CommonEntity::mPosition respresents this point ).
Definition at line 396 of file colmodel.h. Referenced by CollisionModel(). |
|
|
True, if model is ready for applying new transformations.
Definition at line 400 of file colmodel.h. Referenced by CollisionModel(). |
|
|
Vector, that stores rotations.
Definition at line 404 of file colmodel.h. Referenced by CollisionModel(). |
|
|
Box with applyied transformations.
Definition at line 398 of file colmodel.h. Referenced by CollisionModel(), computeMinimalAvoidDistance(), and computeMinimalAvoidVector(). |
|
|
Vector, that stores translations.
Definition at line 402 of file colmodel.h. Referenced by CollisionModel(). |
1.4.5