VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtExampleBallisticsDriver Class Reference

Driver that demonstrates firing GPU tracer bursts and previewing predicted ballistic trajectories.

Inheritance diagram for DtExampleBallisticsDriver:
Inheritance graph
[legend]

Public Member Functions

 DtExampleBallisticsDriver (makVrv::DtAgentManager &am)
 
virtual ~DtExampleBallisticsDriver ()
 
virtual const std::string & className () const
 
virtual bool onStart ()
 
virtual bool onStop ()
 
virtual bool onTick ()
 
- Public Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 
virtual ~DtDriver ()
 
virtual void realizeConfiguration (const DtConfiguration &configuration)
 
virtual DtConfiguration createConfiguration (bool saveAllParameters=false) const
 
DtAgentManager & agentManager ()
 
virtual DtAgentManagerInterface & sceneInterface ()
 
bool started () const
 
virtual const std::string & instanceName () const
 
virtual bool autoStart () const
 
virtual void setAutoStart (bool autoStart)
 
virtual bool isWindowDependent () const
 
virtual void setIsWindowDependent (bool dep)
 
virtual void setIsUserControllable (bool)
 
virtual bool isUserControllable () const
 
virtual void setIsPersistent (bool per)
 
virtual bool isPersistent () const
 
virtual bool isOnDriverSelectionList () const
 
virtual void setOnDriverSelectionList (bool)
 
bool objectFromAgentManager (const DtUniqueID &id) const
 

Protected Member Functions

virtual void computeDirectionVectors (DtVector position, DtVector &east, DtVector &north, DtVector &up)
 
void fireShot (const DtBallisticShotDefinition &def)
 
void predictShot (const DtBallisticShotDefinition &def)
 
void removeArcsFor (const DtBallisticShotDefinition &def)
 
void redrawActivePreviews ()
 
void clearPredictedArcs ()
 
virtual void slot_coordinateSystemChanged ()
 
virtual void slot_windSpeedChanged (float metersPerSecond)
 
virtual void slot_windDirectionChanged (float radians)
 
- Protected Member Functions inherited from makVrv::DtDriver
void applyChangesAndDelete (DtElementChanges *changes)
 
void reportElementCreated (DtElementID id, DtElementID parentId, DtElementEntry::ElementType type)
 
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 
void reportElementDestroyed (DtElementID id)
 
void start ()
 
void stop ()
 
bool tick ()
 
virtual void slot_displayEngineAdded (const DtDeRecord &igRecord)
 
virtual void setInstanceName (const std::string &name)
 
virtual void installAccessories ()
 
virtual void uninstallAccessories ()
 

Protected Attributes

makVrv::DtSignalConnectionManager myConnections
 
makVrv::DtCoordinateSystem * myCoordinateSystem
 
float myWindSpeed
 
float myWindDirection
 
bool myFireRequestedB
 
bool myFireRequestedN
 
bool myFireRequestedM
 
bool myPreviewRequestedB
 
bool myPreviewRequestedN
 
bool myPreviewRequestedM
 
bool myRemoveRequested
 
std::deque
< makVrv::DtBallisticManager::BallisticIdentifier > 
myFiredIdentifiers
 
std::vector< const
DtBallisticShotDefinition * > 
myActivePreviews
 
makVrv::DtEventProcessorInterface * myEventProcessor
 
- Protected Attributes inherited from makVrv::DtDriver
DtAgentManager & myAgentManager
 
bool myStartedFlag
 
std::string myName
 
DtConfiguration myConfiguration
 
bool myPersistentFlag
 
bool myUserControllableFlag
 
bool myRequestStateDiffPendingFlag
 
DtElementChanges myChanges
 
DtSignalConnectionManager myConnections
 

Additional Inherited Members

- Static Protected Attributes inherited from makVrv::DtDriver
static const std::string theOnDriverSelectionList
 

Constructor & Destructor Documentation

DtExampleBallisticsDriver::DtExampleBallisticsDriver ( makVrv::DtAgentManager &  am)

Constructor.

virtual DtExampleBallisticsDriver::~DtExampleBallisticsDriver ( )
virtual

Destructor.

Member Function Documentation

virtual const std::string& DtExampleBallisticsDriver::className ( ) const
virtual

Returns the driver's class name.

Implements makVrv::DtDriver.

virtual bool DtExampleBallisticsDriver::onStart ( )
virtual

Performs startup logic for the driver.

Implements makVrv::DtDriver.

virtual bool DtExampleBallisticsDriver::onStop ( )
virtual

Performs shutdown logic for the driver.

Implements makVrv::DtDriver.

virtual bool DtExampleBallisticsDriver::onTick ( )
virtual

Performs update logic for the driver.

Implements makVrv::DtDriver.

virtual void DtExampleBallisticsDriver::computeDirectionVectors ( DtVector  position,
DtVector &  east,
DtVector &  north,
DtVector &  up 
)
protectedvirtual

Computes local direction vectors for the given world position.

Parameters
positionWorld-space position.
eastReceives the east unit vector.
northReceives the north unit vector.
upReceives the up unit vector.
void DtExampleBallisticsDriver::fireShot ( const DtBallisticShotDefinition &  def)
protected

Fires a GPU tracer burst described by the given shot definition.

void DtExampleBallisticsDriver::predictShot ( const DtBallisticShotDefinition &  def)
protected

Draws the predicted trajectory arcs for the given shot without firing. Any arcs already shown for this shot are removed first, so calling this again (for example after a wind change) replaces rather than duplicates them.

void DtExampleBallisticsDriver::removeArcsFor ( const DtBallisticShotDefinition &  def)
protected

Removes the three predicted arcs previously drawn for one shot.

void DtExampleBallisticsDriver::redrawActivePreviews ( )
protected

Re-predicts every arc currently on screen so it reflects the latest wind speed and direction.

void DtExampleBallisticsDriver::clearPredictedArcs ( )
protected

Removes every predicted trajectory arc previously drawn by predictShot().

virtual void DtExampleBallisticsDriver::slot_coordinateSystemChanged ( )
protectedvirtual

Handles a coordinate-system change.

virtual void DtExampleBallisticsDriver::slot_windSpeedChanged ( float  metersPerSecond)
protectedvirtual

Handles a wind speed change; re-predicts any arcs currently on screen.

Parameters
metersPerSecondNew wind speed in metres per second.
virtual void DtExampleBallisticsDriver::slot_windDirectionChanged ( float  radians)
protectedvirtual

Handles a wind direction change; re-predicts any arcs currently on screen.

Parameters
radiansNew wind direction in radians.

Member Data Documentation

makVrv::DtSignalConnectionManager DtExampleBallisticsDriver::myConnections
protected

Manages signal/slot lifetime connections.

makVrv::DtCoordinateSystem* DtExampleBallisticsDriver::myCoordinateSystem
protected

Local copy of the system-wide coordinate system, kept for thread safety.

float DtExampleBallisticsDriver::myWindSpeed
protected

Current wind speed in metres per second.

float DtExampleBallisticsDriver::myWindDirection
protected

Current wind direction in radians.

bool DtExampleBallisticsDriver::myFireRequestedB
protected

True if 'B' was pressed this frame (fire orange burst).

bool DtExampleBallisticsDriver::myFireRequestedN
protected

True if 'N' was pressed this frame (fire red burst).

bool DtExampleBallisticsDriver::myFireRequestedM
protected

True if 'M' was pressed this frame (fire green burst).

bool DtExampleBallisticsDriver::myPreviewRequestedB
protected

True if Shift+'B' was pressed this frame (preview orange shot).

bool DtExampleBallisticsDriver::myPreviewRequestedN
protected

True if Shift+'N' was pressed this frame (preview red shot).

bool DtExampleBallisticsDriver::myPreviewRequestedM
protected

True if Shift+'M' was pressed this frame (preview green shot).

bool DtExampleBallisticsDriver::myRemoveRequested
protected

True if 'R' was pressed this frame (remove all).

std::deque<makVrv::DtBallisticManager::BallisticIdentifier> DtExampleBallisticsDriver::myFiredIdentifiers
protected

Identifiers of previously fired bursts, stored for removal via the 'R' key.

std::vector<const DtBallisticShotDefinition*> DtExampleBallisticsDriver::myActivePreviews
protected

Shot definitions whose arcs are currently displayed, so they can be re-predicted when the wind changes. Entries point at the stable, static shot table and are never owned by this driver.

makVrv::DtEventProcessorInterface* DtExampleBallisticsDriver::myEventProcessor
protected

Event processor for input handling.


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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)