![]() |
MAK Legion API Documentation
|
Part of the F18 example. More...
Collaboration diagram for DtVehicleSim:Public Member Functions | |
| DtVehicleSim (Legion::SimulationDatabase *database, LOM::EntityView *rel, Legion::UInt64 id, const Legion::ObjectType &type, const std::string &name, const std::string markings, bool haveArtParts) | |
| Constructor. More... | |
| virtual | ~DtVehicleSim () |
| Destructor. More... | |
| virtual void | init (double initLat, double initLon, double initAlt, double initSpeed, double initHeading, double initTRadius, double initPitch, double initRoll, bool autoRoll) |
| Set initial values for simulation parameters. More... | |
| virtual void | simTick (DtTime dt) |
| Call once per frame to simulate, and make necessary VR-Link calls. More... | |
| virtual void | fireMunition (const Legion::UInt64 &targetGid) |
| Fire and detonate functions. More... | |
| virtual void | fireMunition () |
| virtual void | detonateMunition () |
| virtual void | munitionTick () |
| virtual void | processDetonation (const LOM::DetonateEvent &inter) |
| Reaction to detonations. More... | |
| virtual int | checkDetonation (const LOM::DetonateEvent &inter) |
| virtual void | reactToDamage () |
| virtual bool | isDestroyed () |
| virtual DtTime | timeDestroyed () |
| virtual void | toggleEmissions () |
| Emissions (radar) More... | |
| virtual void | enableEmissions () |
| virtual void | disableEmissions () |
| virtual void | setFrozen (bool frozen) |
Static Public Member Functions | |
| static void | setLethalDetonationRange (double range) |
| static void | setMunitionFlightTime (DtTime time) |
Protected Member Functions | |
| virtual void | moveArtParts (DtTime dt) |
| virtual LOM::ReadEntityRepository | nearestEntity () |
| virtual void | emitterSystemAdditionCallback (const std::vector< LOM::ReadEmitterRepository > &obj) |
| virtual void | emitterSystemRemovalCallback (const std::vector< LOM::ReadEmitterRepository > &obj) |
| void | detonationCb (Legion::Span< LOM::DetonateEvent > &events) |
Protected Attributes | |
| Legion::SimulationDatabase * | myDatabase |
| LOM::WriteEntityRepository | myEntityPub |
| LOM::WriteAircraftRepository | myAircraftDetailsPub |
| LOM::WriteArtPartRepository | myArtParts [MAX_ARTPARTS] |
| LOM::WriteEmitterRepository | myEmitterSysPub |
| LOM::EntityView * | myRel |
| Legion::SetView < LOM::ReadEmitterRepository > * | myRefEmitList |
| float | mySpeed |
| float | myTurnRadius |
| float | myTurnRate |
| float | myScalarAccel |
| DtCoordTransform | myLocalToGeoc |
| DtCoordTransform | myGeocToLocal |
| DtTaitBryan | myEuler |
| DtVector | myPos |
| topographic Euler angles More... | |
| DtVector | myVel |
| in topographic (N, E, down) coordinates More... | |
| DtVector | myAccel |
| in topographic (N, E, down) coordinates More... | |
| DtVector | myRotRate |
| in topographic (N, E, down) coordinates More... | |
| float | myTurretAz |
| in body coordinates More... | |
| float | myTurretAzRate |
| float | myGunElev |
| float | myGunElevRate |
| DtTime | myDetonateTime |
| DtTime | myTimeDestroyed |
| bool | myIsDestroyed |
| bool | myHaveArtParts |
| bool | myEmissionsEnabled |
| UInt32 | myDetonateCbHandle |
| UInt64 | myTargetId |
| UInt32 | myFireEvent |
Static Protected Attributes | |
| static double | theLethalDetonationRange = 20.0 |
| static DtTime | theMunitionFlightTime = 3.0 |
Part of the F18 example.
This class simulates a vehicle.
| DtVehicleSim::DtVehicleSim | ( | Legion::SimulationDatabase * | database, |
| LOM::EntityView * | rel, | ||
| Legion::UInt64 | id, | ||
| const Legion::ObjectType & | type, | ||
| const std::string & | name, | ||
| const std::string | markings, | ||
| bool | haveArtParts | ||
| ) |
Constructor.
refLat and refLon are in radians. id is a DIS-style site-app-entity triple, regardless of whether we are using HLA or DIS.
References Legion::EventManager::addEventCallback(), Legion::SetView< SET_TYPE >::addInstanceAddedCallback(), Legion::SetView< SET_TYPE >::addInstanceRemovedCallback(), Legion::SimulationDatabase::createInstance(), Legion::ViewManager::createSetView(), detonationCb(), emitterSystemAdditionCallback(), emitterSystemRemovalCallback(), Legion::SimulationDatabase::eventManager(), myAircraftDetailsPub, myDatabase, myDetonateCbHandle, myDetonateTime, myEmissionsEnabled, myEmitterSysPub, myEntityPub, myHaveArtParts, myIsDestroyed, myRefEmitList, myRel, myTimeDestroyed, and Legion::SimulationDatabase::viewManager().
|
virtual |
Destructor.
References Legion::SimulationDatabase::destroyInstance(), Legion::ViewManager::destroyView(), disableEmissions(), Legion::SimulationDatabase::eventManager(), myDatabase, myDetonateCbHandle, myEntityPub, myRefEmitList, Legion::EventManager::removeEventCallback(), and Legion::SimulationDatabase::viewManager().
|
virtual |
References myEntityPub, and theLethalDetonationRange.
Referenced by processDetonation().
|
virtual |
References Legion::EventManager::addEvent(), Legion::EventManager::createEvent(), Legion::SimulationDatabase::eventManager(), myDatabase, myEntityPub, myFireEvent, myPos, myRel, myTargetId, and theMunitionFlightTime.
Referenced by munitionTick().
|
protected |
References processDetonation(), and Legion::Span< DATA_TYPE >::size().
Referenced by DtVehicleSim().
|
virtual |
References Legion::SimulationDatabase::destroyInstance(), myDatabase, myEmissionsEnabled, myEmitterSysPub, and myEntityPub.
Referenced by toggleEmissions(), and ~DtVehicleSim().
|
protectedvirtual |
Referenced by DtVehicleSim().
|
protectedvirtual |
Referenced by DtVehicleSim().
|
virtual |
References Legion::SimulationDatabase::createInstance(), myDatabase, myEmissionsEnabled, myEmitterSysPub, and myEntityPub.
Referenced by toggleEmissions().
|
virtual |
Fire and detonate functions.
References Legion::EventManager::addEvent(), Legion::EventManager::createEvent(), Legion::SimulationDatabase::eventManager(), myDatabase, myDetonateTime, myEntityPub, myFireEvent, myTargetId, Legion::EventManager::nextId(), Legion::SimulationDatabase::simTime(), and theMunitionFlightTime.
Referenced by keybrdTick().
|
virtual |
References nearestEntity().
|
virtual |
Set initial values for simulation parameters.
References Legion::SimulationDatabase::createInstance(), MAX_ARTPARTS, myAccel, myArtParts, myDatabase, myEntityPub, myEuler, myGeocToLocal, myGunElev, myHaveArtParts, myLocalToGeoc, myPos, myRotRate, myScalarAccel, mySpeed, myTurnRadius, myTurnRate, myTurretAz, myTurretAzRate, and myVel.
Referenced by main().
|
virtual |
References myIsDestroyed.
Referenced by main().
|
protectedvirtual |
References MAX_ARTPARTS, myArtParts, myDatabase, and Legion::SimulationDatabase::simTime().
Referenced by simTick().
|
virtual |
References detonateMunition(), myDatabase, myDetonateTime, myFireEvent, and Legion::SimulationDatabase::simTime().
Referenced by simTick().
|
protectedvirtual |
References myEntityPub, and myRel.
Referenced by fireMunition().
|
virtual |
Reaction to detonations.
References checkDetonation(), and reactToDamage().
Referenced by detonationCb().
|
virtual |
References myAccel, myAircraftDetailsPub, myDatabase, myEntityPub, myIsDestroyed, myRotRate, mySpeed, myTimeDestroyed, myTurnRate, myVel, and Legion::SimulationDatabase::simTime().
Referenced by processDetonation().
|
virtual |
References myEntityPub.
Referenced by keybrdTick().
|
static |
References theLethalDetonationRange.
Referenced by main().
|
static |
References theMunitionFlightTime.
Referenced by main().
|
virtual |
Call once per frame to simulate, and make necessary VR-Link calls.
References moveArtParts(), munitionTick(), myAccel, myEntityPub, myEuler, myHaveArtParts, myLocalToGeoc, myPos, myRotRate, myScalarAccel, myTurnRate, and myVel.
Referenced by main().
|
virtual |
References myTimeDestroyed.
Referenced by main().
|
virtual |
Emissions (radar)
References disableEmissions(), enableEmissions(), and myEmissionsEnabled.
Referenced by keybrdTick().
|
protected |
in topographic (N, E, down) coordinates
Referenced by init(), reactToDamage(), and simTick().
|
protected |
Referenced by DtVehicleSim(), and reactToDamage().
|
protected |
Referenced by init(), and moveArtParts().
|
protected |
Referenced by detonateMunition(), disableEmissions(), DtVehicleSim(), enableEmissions(), fireMunition(), init(), moveArtParts(), munitionTick(), reactToDamage(), and ~DtVehicleSim().
|
protected |
Referenced by DtVehicleSim(), and ~DtVehicleSim().
|
protected |
Referenced by DtVehicleSim(), fireMunition(), and munitionTick().
|
protected |
Referenced by disableEmissions(), DtVehicleSim(), enableEmissions(), and toggleEmissions().
|
protected |
Referenced by disableEmissions(), DtVehicleSim(), and enableEmissions().
|
protected |
|
protected |
Referenced by detonateMunition(), fireMunition(), and munitionTick().
|
protected |
Referenced by init().
|
protected |
Referenced by init().
|
protected |
|
protected |
Referenced by DtVehicleSim(), init(), and simTick().
|
protected |
Referenced by DtVehicleSim(), isDestroyed(), and reactToDamage().
|
protected |
topographic Euler angles
Referenced by detonateMunition(), init(), and simTick().
|
protected |
Referenced by DtVehicleSim(), and ~DtVehicleSim().
|
protected |
Referenced by detonateMunition(), DtVehicleSim(), and nearestEntity().
|
protected |
in topographic (N, E, down) coordinates
Referenced by init(), reactToDamage(), and simTick().
|
protected |
Referenced by init(), and reactToDamage().
|
protected |
Referenced by detonateMunition(), and fireMunition().
|
protected |
Referenced by DtVehicleSim(), reactToDamage(), and timeDestroyed().
|
protected |
Referenced by init().
|
protected |
Referenced by init(), reactToDamage(), and simTick().
|
protected |
in body coordinates
Referenced by init().
|
protected |
Referenced by init().
|
protected |
in topographic (N, E, down) coordinates
Referenced by init(), reactToDamage(), and simTick().
|
staticprotected |
Referenced by checkDetonation(), and setLethalDetonationRange().
|
staticprotected |
Referenced by detonateMunition(), fireMunition(), and setMunitionFlightTime().