VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Private Member Functions
DtBallisticGunJoy Class Reference

DtBallisticGunJoy extends the DtBallisticGun actuator class with the ability to be controlled from a joystick. More...

Inheritance diagram for DtBallisticGunJoy:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtBallisticGunJoy (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *const parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtBallisticGunJoy ()
 destructor
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool createPorts ()
 Creates myElevationPort.
virtual void setComponentDescriptor (DtComponentDescriptor *descriptor)
 Override so we can extract the values we want and set our pointer.
virtual void tick ()
 Fire and detonate.
virtual DtReal setTarget (DtArticulatedPartStateRepository *rotBody)
virtual DtFireInteraction * manualFireInteraction (DtArticulatedPartStateRepository *rotBody)
virtual DtDetonationInteractionmanualDetonationInteraction (DtArticulatedPartStateRepository *rotBody, DtReal &detTime, DtReal dist)
virtual DtVrfObjecttargetSelection (DtArticulatedPartStateRepository *rotBody, DtReal &dist)
virtual DtReal distanceToTarget ()

Static Public Member Functions

static void detonationCallback (DtTimer *timer)
 Casts the user data portion of the DtTimer passed to it to a DtDetonationTimerData object.
static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Attributes

Ports and Port Groups
DtConstrainedAnalogInputPortmyElevationPort
 Input Port Name: elevation
Input Port Description:
Input Port Range: -1.
DtBooleanInputPortmyActiveJoystickPort
 Input Port Name: joystick-active
Input Port Description:
Input Port Range:
Input Port Default Value:
Input Group Parent: gun-control.

Private Member Functions

 DtBallisticGunJoy ()
 Default constructor; should not be called.
 DtBallisticGunJoy (const DtBallisticGunJoy &orig)
 copy constructor; shallow copy - timers not copied
const DtBallisticGunJoyoperator= (const DtBallisticGunJoy &orig)
 assignment operator; see comments on copy constructor!

Detailed Description

DtBallisticGunJoy extends the DtBallisticGun actuator class with the ability to be controlled from a joystick.

Uses Descriptor Type: DtBallisticGunDescriptor


Constructor & Destructor Documentation

DtBallisticGunJoy::DtBallisticGunJoy ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc,
DtReaderWriterRegistry *const  parentRegistry = 0 
)

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

destructor

Default constructor; should not be called.

Here because the compiler will generate an unprotected one otherwise.

copy constructor; shallow copy - timers not copied


Member Function Documentation

virtual DtString DtBallisticGunJoy::type ( ) const [virtual]

Returns a string identifies the class type of component.

Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.

Returns:
DtBallisticGunJoyActuatorType

Reimplemented from DtBallisticGun.

virtual bool DtBallisticGunJoy::createPorts ( ) [virtual]

Creates myElevationPort.

Reimplemented from DtBallisticGun.

virtual void DtBallisticGunJoy::setComponentDescriptor ( DtComponentDescriptor descriptor) [virtual]

Override so we can extract the values we want and set our pointer.

Calls down to the base class's set.

Reimplemented from DtSimComponent.

virtual void DtBallisticGunJoy::tick ( ) [virtual]

Fire and detonate.

It detects if we need to use local or parent function depending on joystick enable/disable state

Reimplemented from DtBallisticGun.

virtual DtReal DtBallisticGunJoy::setTarget ( DtArticulatedPartStateRepository rotBody) [virtual]
virtual DtFireInteraction* DtBallisticGunJoy::manualFireInteraction ( DtArticulatedPartStateRepository rotBody) [virtual]
virtual DtDetonationInteraction* DtBallisticGunJoy::manualDetonationInteraction ( DtArticulatedPartStateRepository rotBody,
DtReal &  detTime,
DtReal  dist 
) [virtual]
virtual DtVrfObject* DtBallisticGunJoy::targetSelection ( DtArticulatedPartStateRepository rotBody,
DtReal &  dist 
) [virtual]
virtual DtReal DtBallisticGunJoy::distanceToTarget ( ) [virtual]
static void DtBallisticGunJoy::detonationCallback ( DtTimer timer) [static]

Casts the user data portion of the DtTimer passed to it to a DtDetonationTimerData object.

It then uses the pointer to the Simulation Manager provided in the DtDetonationTimerData to get a pointer to the DtExerciseConn, and sends the DtDetonationInteraction which is also in the DtDetonationTimerData object via the exercise connection. The timer is removed from the scheduler, and the DtDetonationTimerData and DtDetonationInteraction objects are deleted.

Reimplemented from DtBallisticGun.

static DtSimComponent* DtBallisticGunJoy::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
) [static]

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns:
New instance of this class.

Reimplemented from DtBallisticGun.

const DtBallisticGunJoy& DtBallisticGunJoy::operator= ( const DtBallisticGunJoy orig) [private]

assignment operator; see comments on copy constructor!


Member Data Documentation

Input Port Name: elevation
Input Port Description:
Input Port Range: -1.

to 1.
Input Port Default Value:
Input Group Parent: gun-control

Input Port Name: joystick-active
Input Port Description:
Input Port Range:
Input Port Default Value:
Input Group Parent: gun-control.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)