MAK Legion API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DtVehicleSim Class Reference

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::SimulationDatabasemyDatabase
 
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
 

Detailed Description

Part of the F18 example.

This class simulates a vehicle.

Constructor & Destructor Documentation

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 
)
DtVehicleSim::~DtVehicleSim ( )
virtual

Member Function Documentation

int DtVehicleSim::checkDetonation ( const LOM::DetonateEvent &  inter)
virtual

References myEntityPub, and theLethalDetonationRange.

Referenced by processDetonation().

void DtVehicleSim::detonateMunition ( )
virtual
void DtVehicleSim::detonationCb ( Legion::Span< LOM::DetonateEvent > &  events)
protected
void DtVehicleSim::disableEmissions ( )
virtual
void DtVehicleSim::emitterSystemAdditionCallback ( const std::vector< LOM::ReadEmitterRepository > &  obj)
protectedvirtual

Referenced by DtVehicleSim().

void DtVehicleSim::emitterSystemRemovalCallback ( const std::vector< LOM::ReadEmitterRepository > &  obj)
protectedvirtual

Referenced by DtVehicleSim().

void DtVehicleSim::enableEmissions ( )
virtual
void DtVehicleSim::fireMunition ( const Legion::UInt64 targetGid)
virtual
void DtVehicleSim::fireMunition ( )
virtual

References nearestEntity().

void DtVehicleSim::init ( double  initLat,
double  initLon,
double  initAlt,
double  initSpeed,
double  initHeading,
double  initTRadius,
double  initPitch,
double  initRoll,
bool  autoRoll 
)
virtual
bool DtVehicleSim::isDestroyed ( )
virtual

References myIsDestroyed.

Referenced by main().

void DtVehicleSim::moveArtParts ( DtTime  dt)
protectedvirtual
void DtVehicleSim::munitionTick ( )
virtual
LOM::ReadEntityRepository DtVehicleSim::nearestEntity ( )
protectedvirtual

References myEntityPub, and myRel.

Referenced by fireMunition().

void DtVehicleSim::processDetonation ( const LOM::DetonateEvent &  inter)
virtual

Reaction to detonations.

References checkDetonation(), and reactToDamage().

Referenced by detonationCb().

void DtVehicleSim::reactToDamage ( )
virtual
void DtVehicleSim::setFrozen ( bool  frozen)
virtual

References myEntityPub.

Referenced by keybrdTick().

void DtVehicleSim::setLethalDetonationRange ( double  range)
static

References theLethalDetonationRange.

Referenced by main().

void DtVehicleSim::setMunitionFlightTime ( DtTime  time)
static

References theMunitionFlightTime.

Referenced by main().

void DtVehicleSim::simTick ( DtTime  dt)
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().

DtTime DtVehicleSim::timeDestroyed ( )
virtual

References myTimeDestroyed.

Referenced by main().

void DtVehicleSim::toggleEmissions ( )
virtual

Emissions (radar)

References disableEmissions(), enableEmissions(), and myEmissionsEnabled.

Referenced by keybrdTick().

Member Data Documentation

DtVector DtVehicleSim::myAccel
protected

in topographic (N, E, down) coordinates

Referenced by init(), reactToDamage(), and simTick().

LOM::WriteAircraftRepository DtVehicleSim::myAircraftDetailsPub
protected

Referenced by DtVehicleSim(), and reactToDamage().

LOM::WriteArtPartRepository DtVehicleSim::myArtParts[MAX_ARTPARTS]
protected

Referenced by init(), and moveArtParts().

Legion::SimulationDatabase* DtVehicleSim::myDatabase
protected
UInt32 DtVehicleSim::myDetonateCbHandle
protected

Referenced by DtVehicleSim(), and ~DtVehicleSim().

DtTime DtVehicleSim::myDetonateTime
protected
bool DtVehicleSim::myEmissionsEnabled
protected
LOM::WriteEmitterRepository DtVehicleSim::myEmitterSysPub
protected
LOM::WriteEntityRepository DtVehicleSim::myEntityPub
protected
DtTaitBryan DtVehicleSim::myEuler
protected

Referenced by init(), and simTick().

UInt32 DtVehicleSim::myFireEvent
protected
DtCoordTransform DtVehicleSim::myGeocToLocal
protected

Referenced by init().

float DtVehicleSim::myGunElev
protected

Referenced by init().

float DtVehicleSim::myGunElevRate
protected
bool DtVehicleSim::myHaveArtParts
protected

Referenced by DtVehicleSim(), init(), and simTick().

bool DtVehicleSim::myIsDestroyed
protected
DtCoordTransform DtVehicleSim::myLocalToGeoc
protected

Referenced by init(), and simTick().

DtVector DtVehicleSim::myPos
protected

topographic Euler angles

Referenced by detonateMunition(), init(), and simTick().

Legion::SetView<LOM::ReadEmitterRepository>* DtVehicleSim::myRefEmitList
protected

Referenced by DtVehicleSim(), and ~DtVehicleSim().

LOM::EntityView* DtVehicleSim::myRel
protected
DtVector DtVehicleSim::myRotRate
protected

in topographic (N, E, down) coordinates

Referenced by init(), reactToDamage(), and simTick().

float DtVehicleSim::myScalarAccel
protected

Referenced by init(), and simTick().

float DtVehicleSim::mySpeed
protected

Referenced by init(), and reactToDamage().

UInt64 DtVehicleSim::myTargetId
protected

Referenced by detonateMunition(), and fireMunition().

DtTime DtVehicleSim::myTimeDestroyed
protected
float DtVehicleSim::myTurnRadius
protected

Referenced by init().

float DtVehicleSim::myTurnRate
protected

Referenced by init(), reactToDamage(), and simTick().

float DtVehicleSim::myTurretAz
protected

in body coordinates

Referenced by init().

float DtVehicleSim::myTurretAzRate
protected

Referenced by init().

DtVector DtVehicleSim::myVel
protected

in topographic (N, E, down) coordinates

Referenced by init(), reactToDamage(), and simTick().

double DtVehicleSim::theLethalDetonationRange = 20.0
staticprotected
double DtVehicleSim::theMunitionFlightTime = 3.0
staticprotected

The documentation for this class was generated from the following files:

Document ID: Generated on Mon Mar 8 15:11:30 EST 2021 from SVN revision 225633
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)