|
void | reset () |
| Initialises all track objects.
|
|
void | init () |
| Initialises all track objects.
|
|
void | add (const XMLNode &xml_node, scene::ISceneNode *parent, ModelDefinitionLoader &model_def_loader, TrackObject *parent_library) |
| Adds an object to the track object manager.
|
|
void | updateGraphics (float dt) |
| Updates all track objects.
|
|
void | update (float dt) |
| Updates all track objects.
|
|
void | resetAfterRewind () |
|
void | handleExplosion (const Vec3 &pos, const PhysicalObject *mp, bool secondary_hits=true) |
| Handles an explosion, i.e.
|
|
bool | castRay (const btVector3 &from, const btVector3 &to, btVector3 *hit_point, const Material **material, btVector3 *normal=NULL, bool interpolate_normal=false) const |
| Does a raycast against all driveable objects.
|
|
void | insertObject (TrackObject *object) |
|
void | insertDriveableObject (TrackObject *object) |
|
void | removeObject (TrackObject *who) |
| Removes the object from the scene graph, bullet, and the list of track objects, and then frees the object.
|
|
void | removeDriveableObject (TrackObject *obj) |
|
TrackObject * | getTrackObject (const std::string &libraryInstance, const std::string &name) |
| returns a reference to the track object with a particular ID
|
|
PtrVector< TrackObject > & | getObjects () |
|
const PtrVector< TrackObject > & | getObjects () const |
|
|
enum | TrackObjectType { TO_PHYSICAL
, TO_GRAPHICAL
} |
| The different type of track objects: physical objects, graphical objects (without a physical representation) - the latter might be eye candy (to reduce work for physics), ...
|
|
◆ add()
Adds an object to the track object manager.
The type to add is specified in the xml_node.
◆ castRay()
bool TrackObjectManager::castRay |
( |
const btVector3 & |
from, |
|
|
const btVector3 & |
to, |
|
|
btVector3 * |
hit_point, |
|
|
const Material ** |
material, |
|
|
btVector3 * |
normal = NULL , |
|
|
bool |
interpolate_normal = false |
|
) |
| const |
Does a raycast against all driveable objects.
This way part of the track can be a physical object, and can e.g. be animated. A separate list of all driveable objects is maintained (in one case there were over 2000 bodies, but only one is driveable). The result of the raycast against the track mesh are the input parameter. It is then tested if the raycast against a track object gives a 'closer' result. If so, the parameters hit_point, normal, and material will be updated.
- Parameters
-
from/to | The from and to position for the raycast. |
xyz | The position in world where the ray hit. |
material | The material of the mesh that was hit. |
normal | The intrapolated normal at that position. |
interpolate_normal | If true, the returned normal is the interpolated based on the three normals of the triangle and the location of the hit point (which is more compute intensive, but results in much smoother results). |
- Returns
- True if a triangle was hit, false otherwise (and no output variable will be set.
◆ getTrackObject()
TrackObject * TrackObjectManager::getTrackObject |
( |
const std::string & |
libraryInstance, |
|
|
const std::string & |
name |
|
) |
| |
returns a reference to the track object with a particular ID
- Parameters
-
name | Name or ID of track object |
◆ handleExplosion()
void TrackObjectManager::handleExplosion |
( |
const Vec3 & |
pos, |
|
|
const PhysicalObject * |
mp, |
|
|
bool |
secondary_hits = true |
|
) |
| |
Handles an explosion, i.e.
it makes sure that all physical objects are affected accordingly.
- Parameters
-
pos | Position of the explosion. |
obj | If the hit was a physical object, this object will be affected more. Otherwise this is NULL. |
secondary_hits | True if items that are not directly hit should also be affected. |
◆ removeObject()
void TrackObjectManager::removeObject |
( |
TrackObject * |
obj | ) |
|
Removes the object from the scene graph, bullet, and the list of track objects, and then frees the object.
- Parameters
-
obj | The physical object to remove. |
◆ update()
void TrackObjectManager::update |
( |
float |
dt | ) |
|
Updates all track objects.
- Parameters
-
◆ updateGraphics()
void TrackObjectManager::updateGraphics |
( |
float |
dt | ) |
|
Updates all track objects.
- Parameters
-
The documentation for this class was generated from the following files: