#include <groundclamper.h>
Public Member Functions | |
| GroundClamper () | |
| virtual | ~GroundClamper () |
| dtCore::Transformable * | GetTerrainActor () |
| |
| const dtCore::Transformable * | GetTerrainActor () const |
| |
| void | SetTerrainActor (dtCore::Transformable *newTerrain) |
| changes the actor to use for the terrain. | |
| void | UpdateEyePoint () |
| Caches the eyepoint from the eye point actor. This MUST be called each frame before clamping. | |
| const osg::Vec3 & | GetLastEyePoint () const |
| dtCore::Transformable * | GetEyePointActor () |
| |
| const dtCore::Transformable * | GetEyePointActor () const |
| |
| void | SetEyePointActor (dtCore::Transformable *newEyePointActor) |
| changes the actor to use for the terrain. | |
| void | SetHighResGroundClampingRange (float range) |
| Sets the maximum distance from the player that three intersection point clamping will be used. | |
| float | GetHighResGroundClampingRange () const |
| |
| void | SetLowResGroundClampingRange (float range) |
| Sets the maximum distance from the player that three intersection point clamping will be used. | |
| float | GetLowResGroundClampingRange () const |
| |
| void | SetIntermittentGroundClampingTimeDelta (float newDelta) |
| Sets the delta time between clamping when clamping in intermittent mode. | |
| float | GetIntermittentGroundClampingTimeDelta () const |
| |
| void | SetIntermittentGroundClampingSmoothingTime (float newTime) |
| Sets the smoothing time between offsets when clamping in intermittent mode. | |
| float | GetIntermittentGroundClampingSmoothingTime () const |
| |
| void | CalculateAndSetBoundingBox (osg::Vec3 &modelDimensions, dtGame::GameActorProxy &gameActorProxy, GroundClampingData &data) |
| Calculates the bounding box for the given proxy, stores it in the data object, and populates the Vec3. | |
| bool | GetClosestHit (dtCore::BatchIsector::SingleISector &single, float pointz, osg::Vec3 &hit, osg::Vec3 &normal) |
| Gets the ground clamping hit that is closest to the deadreckoned z value. | |
| void | ClampToGround (GroundClampingType &type, double currentTime, dtCore::Transform &xform, dtGame::GameActorProxy &gameActorProxy, GroundClampingData &data) |
| Clamps an actor to the ground. | |
| void | ClampToGroundThreePoint (dtCore::Transform &xform, dtGame::GameActorProxy &gameActorProxy, GroundClampingData &data) |
| Version of clamping that uses three intersection points to calculate the height and the rotation. | |
| void | ClampToGroundIntermittent (double currentTime, dtCore::Transform &xform, dtGame::GameActorProxy &gameActorProxy, GroundClampingData &data) |
| Clamps an actor to the ground by running an intersection query occasionally and saving the offset. | |
| void | RunClampBatch () |
| This should be called manually at the end an group of ground clamping calls. | |
| dtCore::BatchIsector & | GetGroundClampIsector () |
Classes | |
| class | GroundClampingType |
| dtGame::GroundClamper::GroundClamper | ( | ) |
| dtGame::GroundClamper::~GroundClamper | ( | ) | [virtual] |
| dtCore::Transformable* dtGame::GroundClamper::GetTerrainActor | ( | ) | [inline] |
| const dtCore::Transformable* dtGame::GroundClamper::GetTerrainActor | ( | ) | const [inline] |
| void dtGame::GroundClamper::SetTerrainActor | ( | dtCore::Transformable * | newTerrain | ) |
changes the actor to use for the terrain.
| void dtGame::GroundClamper::UpdateEyePoint | ( | ) |
Caches the eyepoint from the eye point actor. This MUST be called each frame before clamping.
| const osg::Vec3& dtGame::GroundClamper::GetLastEyePoint | ( | ) | const [inline] |
| dtCore::Transformable* dtGame::GroundClamper::GetEyePointActor | ( | ) | [inline] |
| const dtCore::Transformable* dtGame::GroundClamper::GetEyePointActor | ( | ) | const [inline] |
| void dtGame::GroundClamper::SetEyePointActor | ( | dtCore::Transformable * | newEyePointActor | ) |
changes the actor to use for the terrain.
| void dtGame::GroundClamper::SetHighResGroundClampingRange | ( | float | range | ) |
Sets the maximum distance from the player that three intersection point clamping will be used.
After this, one intersection will be used. < 0 means don't do high res.
| float dtGame::GroundClamper::GetHighResGroundClampingRange | ( | ) | const [inline] |
| void dtGame::GroundClamper::SetLowResGroundClampingRange | ( | float | range | ) |
Sets the maximum distance from the player that three intersection point clamping will be used.
After this, one intersection will be used. < 0 means don't do low res.
| float dtGame::GroundClamper::GetLowResGroundClampingRange | ( | ) | const [inline] |
| void dtGame::GroundClamper::SetIntermittentGroundClampingTimeDelta | ( | float | newDelta | ) | [inline] |
Sets the delta time between clamping when clamping in intermittent mode.
| float dtGame::GroundClamper::GetIntermittentGroundClampingTimeDelta | ( | ) | const [inline] |
| void dtGame::GroundClamper::SetIntermittentGroundClampingSmoothingTime | ( | float | newTime | ) | [inline] |
Sets the smoothing time between offsets when clamping in intermittent mode.
| float dtGame::GroundClamper::GetIntermittentGroundClampingSmoothingTime | ( | ) | const [inline] |
| void dtGame::GroundClamper::CalculateAndSetBoundingBox | ( | osg::Vec3 & | modelDimensions, | |
| dtGame::GameActorProxy & | gameActorProxy, | |||
| GroundClampingData & | data | |||
| ) |
Calculates the bounding box for the given proxy, stores it in the data object, and populates the Vec3.
| bool dtGame::GroundClamper::GetClosestHit | ( | dtCore::BatchIsector::SingleISector & | single, | |
| float | pointz, | |||
| osg::Vec3 & | hit, | |||
| osg::Vec3 & | normal | |||
| ) |
Gets the ground clamping hit that is closest to the deadreckoned z value.
| void dtGame::GroundClamper::ClampToGround | ( | GroundClamper::GroundClampingType & | type, | |
| double | currentTime, | |||
| dtCore::Transform & | xform, | |||
| dtGame::GameActorProxy & | gameActorProxy, | |||
| GroundClampingData & | data | |||
| ) |
Clamps an actor to the ground.
It will pick, based on the type and eye point which algorithm to Use.
| type | the ground clamping type to perform. | |
| currentTime | the current simulation time. Used for intermittent gc. | |
| xform | the current absolute transform of the actor. | |
| gameActorProxy | the actual actor. This is passed case collision geometry is needed. | |
| helper | the deadreckoning helper for the actor |
| void dtGame::GroundClamper::ClampToGroundThreePoint | ( | dtCore::Transform & | xform, | |
| dtGame::GameActorProxy & | gameActorProxy, | |||
| GroundClampingData & | data | |||
| ) |
Version of clamping that uses three intersection points to calculate the height and the rotation.
| void dtGame::GroundClamper::ClampToGroundIntermittent | ( | double | currentTime, | |
| dtCore::Transform & | xform, | |||
| dtGame::GameActorProxy & | gameActorProxy, | |||
| GroundClampingData & | data | |||
| ) |
Clamps an actor to the ground by running an intersection query occasionally and saving the offset.
| currentTime | the current simulation time. | |
| xform | the current absolute transform of the actor. | |
| gameActorProxy | the actual actor. This is passed case collision geometry is needed. | |
| helper | the deadreckoning helper for the actor |
| void dtGame::GroundClamper::RunClampBatch | ( | ) |
This should be called manually at the end an group of ground clamping calls.
It will go through any remaining ground clamping queries and run them in a batch. This is normally called when the number queued reaches a threshold, but in most cases some are left waiting at the end of a group of calls.
| dtCore::BatchIsector & dtGame::GroundClamper::GetGroundClampIsector | ( | ) |