#include <ReloadPlane.h>
Inheritance diagram for random_racer::ReloadPlane:

Public Member Functions | |
| ReloadPlane (VRS::SO< VRS::SceneThing > parentThing, VRS::SO< VRS::Callback1< unsigned int > > collisionCallback, unsigned int id, bool propagateToOtherThread=true) | |
| Ctor. | |
| virtual | ~ReloadPlane () |
| Dtor. | |
| void | relocate (VRS::Vector normal, double distance) |
| Moves the plane to a new position with a normal and a distance. | |
| void | relocate (double distance) |
| Moves the plane by just adjusting its anchor/distance. | |
| void | setDebug (bool enable=true) |
| Enables / disables the debug shape of this plane. | |
| void | handleCollisionFromThread () |
| Gets called when we collide with some other object,. | |
| void | checkForCollision () |
| Gets called from the main (VRS) thread and basicly checks if m_collidedRecently is true and if so calls m_callback. | |
Private Attributes | |
| VRS::SO< vrsode::CollisionBody > | m_car |
| VRS::SO< VRS::SceneThing > | m_parentThing |
| VRS::SO< VRS::SceneThing > | m_sceneThing |
| VRS::SO< vrsode::PlaneShape > | m_shape |
| VRS::SO< PlaneWrapper > | m_ownBody |
| unsigned int | m_planeId |
| bool | m_collidedRecently |
| bool | m_propagate |
| bool | m_gotIt |
| VRS::SO< VRS::Callback1< unsigned int > > | m_callback |
Classes | |
| class | PlaneWrapper |
| A private class used to wrap the CollisionBody of the plane because one cannot set a shape for a body after its construction. More... | |
This are the objects which others create to get planes with which the car can collide and which then call a given callback method so one can react to the collision.
Definition at line 37 of file ReloadPlane.h.
| random_racer::ReloadPlane::ReloadPlane | ( | VRS::SO< VRS::SceneThing > | parentThing, | |
| VRS::SO< VRS::Callback1< unsigned int > > | collisionCallback, | |||
| unsigned int | id, | |||
| bool | propagateToOtherThread = true | |||
| ) |
Ctor.
| parentThing | The SceneThing into which we should hang us. | |
| collisionCallback | The Callback object which we will call (in the main thread after a checkForCollision() call) when we collided. | |
| id | The id of this plane which we will pass in the callback to identify the plane. | |
| propagateToOtherThread | If set true this just sets m_collidedRecently to true and the callback gets triggered when you call checkForCollision(), if false this will not happen and m_callback will be called imediatly. This is usefull when you want to handle the collision in the same thread as in which you found out there was a collision (ODETerrainLoader). |
| random_racer::ReloadPlane::~ReloadPlane | ( | ) | [virtual] |
| void random_racer::ReloadPlane::relocate | ( | VRS::Vector | normal, | |
| double | distance | |||
| ) | [inline] |
Moves the plane to a new position with a normal and a distance.
Definition at line 117 of file ReloadPlane.h.
References m_shape.
| void random_racer::ReloadPlane::relocate | ( | double | distance | ) | [inline] |
Moves the plane by just adjusting its anchor/distance.
Definition at line 125 of file ReloadPlane.h.
References m_shape.
| void random_racer::ReloadPlane::setDebug | ( | bool | enable = true |
) | [inline] |
Enables / disables the debug shape of this plane.
Definition at line 133 of file ReloadPlane.h.
References m_ownBody.
| void random_racer::ReloadPlane::handleCollisionFromThread | ( | ) |
Gets called when we collide with some other object,.
Definition at line 65 of file ReloadPlane.cpp.
References random_utils::ThreadSafeObject::lock(), m_callback, m_collidedRecently, m_gotIt, m_planeId, m_propagate, and random_utils::ThreadSafeObject::unlock().
Here is the call graph for this function:

| void random_racer::ReloadPlane::checkForCollision | ( | ) |
Gets called from the main (VRS) thread and basicly checks if m_collidedRecently is true and if so calls m_callback.
Definition at line 87 of file ReloadPlane.cpp.
References random_utils::ThreadSafeObject::lock(), m_callback, m_collidedRecently, m_gotIt, m_planeId, and random_utils::ThreadSafeObject::unlock().
Here is the call graph for this function:

VRS::SO<vrsode::CollisionBody> random_racer::ReloadPlane::m_car [private] |
Definition at line 74 of file ReloadPlane.h.
VRS::SO<VRS::SceneThing> random_racer::ReloadPlane::m_parentThing [private] |
VRS::SO<VRS::SceneThing> random_racer::ReloadPlane::m_sceneThing [private] |
VRS::SO<vrsode::PlaneShape> random_racer::ReloadPlane::m_shape [private] |
VRS::SO<PlaneWrapper> random_racer::ReloadPlane::m_ownBody [private] |
unsigned int random_racer::ReloadPlane::m_planeId [private] |
Definition at line 78 of file ReloadPlane.h.
Referenced by checkForCollision(), and handleCollisionFromThread().
bool random_racer::ReloadPlane::m_collidedRecently [private] |
Definition at line 79 of file ReloadPlane.h.
Referenced by checkForCollision(), and handleCollisionFromThread().
bool random_racer::ReloadPlane::m_propagate [private] |
bool random_racer::ReloadPlane::m_gotIt [private] |
Definition at line 79 of file ReloadPlane.h.
Referenced by checkForCollision(), and handleCollisionFromThread().
VRS::SO<VRS::Callback1<unsigned int> > random_racer::ReloadPlane::m_callback [private] |
Definition at line 81 of file ReloadPlane.h.
Referenced by checkForCollision(), and handleCollisionFromThread().
1.5.1