VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
DtUnderFireDeterminationSensor Class Reference

DtUnderFireDeterminationSensor is a sensor that provides, together with the fire manager, a simple under-fire determination model. More...

Inheritance diagram for DtUnderFireDeterminationSensor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtUnderFireDeterminationSensor (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=NULL, DtReaderWriterRegistry *parentRegistry=NULL)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtUnderFireDeterminationSensor ()
 destructor Unregisters with the detonation manager.
virtual bool init ()
 Registers with the fire manager.
virtual bool determineUnderFire (const DtFireContext &fireContext)
 When a fire context is received, from the fire manager, it is processed in order to determine if the entity is under fire.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void tick ()
 Checks to see if the flaming and smoking indicators should be turned off.
virtual bool tickWhileDestroyed () const
 We want the tick to be ticked while destroyed so that dead entities can clear their under fire state.

Static Public Member Functions

static bool processFireCallback (const DtFireContext &fireContext, void *usr)
 The fire manager uses this function to notify the sensor of when it needs to process a detonation for the entity.
static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual bool registerForFireNotifications ()
 Registers the entity to receive notification of appropriate fire interactions.
virtual bool unregisterForFireNotifications ()
 Unregisters the entity to receive notification of appropriate fire interactions.
virtual void setUnderFire (const DtFireContext &fireContext)
 Sets the under fire and the "last time fired upon" in the state repository.
virtual void clearUnderFire ()
 Sets the under-fire state in the state repository to false.
virtual bool isRegisteredForFireNotifications ()
 Keep track of whether or not we have registered with the fire manager for notification of fire and detonations for under-fire processing.
virtual void setIsRegisteredForFireNotifications (bool yesOrNo)
 Keep track of whether or not we have registered with the fire manager for notification of fire and detonations for under-fire processing.

Protected Attributes

DtUnderFireDeterminationComponentDescriptormyUnderFireComponentDescriptor

Private Member Functions

 DtUnderFireDeterminationSensor ()
 Default constructor; not implemented.
 DtUnderFireDeterminationSensor (const DtUnderFireDeterminationSensor &orig)
 copy constructor; not implemented
const
DtUnderFireDeterminationSensor
operator= (const DtUnderFireDeterminationSensor &orig)
 assignment operator; not implemented

Private Attributes

bool myIsRegisteredForFireNotifications

Detailed Description

DtUnderFireDeterminationSensor is a sensor that provides, together with the fire manager, a simple under-fire determination model.

Developer Description: The under-fire determination sensor registers a callback with the fire manager to receive callbacks when appropriate fire interactions occur. If the fire context, containing the fire interaction and relevant details, specifies either the entity, or that a detonation occurred within the user specified range, then it determines that the entity is under fire.

Uses Descriptor Type: DtUnderFireDeterminationComponentDescriptor


Constructor & Destructor Documentation

DtUnderFireDeterminationSensor::DtUnderFireDeterminationSensor ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = NULL,
DtReaderWriterRegistry parentRegistry = NULL 
)

(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 Unregisters with the detonation manager.

Default constructor; not implemented.

copy constructor; not implemented


Member Function Documentation

Registers with the fire manager.

Provides the fire manager a pointer to the component's entity and to the entity's global ID. Relies on the destructor and the setDestroyed callback for unregistering for fire notifications (from the fire manager).

Reimplemented from DtSimComponent.

static bool DtUnderFireDeterminationSensor::processFireCallback ( const DtFireContext fireContext,
void *  usr 
) [static]

The fire manager uses this function to notify the sensor of when it needs to process a detonation for the entity.

Parameters:
fireContextThe fire context to process
usrA pointer to the under fire determination sensor that should process the detonation context.
See also:
determineUnderFire()
virtual bool DtUnderFireDeterminationSensor::determineUnderFire ( const DtFireContext fireContext) [virtual]

When a fire context is received, from the fire manager, it is processed in order to determine if the entity is under fire.

Calls setUnderFire() when the entity is determined to be under fire.

virtual DtString DtUnderFireDeterminationSensor::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:
DtUnderFireDeterminationSensorType

Reimplemented from DtSimComponent.

virtual void DtUnderFireDeterminationSensor::tick ( ) [virtual]

Checks to see if the flaming and smoking indicators should be turned off.

Reimplemented from DtSimComponent.

We want the tick to be ticked while destroyed so that dead entities can clear their under fire state.

Reimplemented from DtSimComponent.

static DtSimComponent* DtUnderFireDeterminationSensor::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.

Registers the entity to receive notification of appropriate fire interactions.

Unregisters the entity to receive notification of appropriate fire interactions.

Keep track of whether or not we have registered with the fire manager for notification of fire and detonations for under-fire processing.

virtual void DtUnderFireDeterminationSensor::setIsRegisteredForFireNotifications ( bool  yesOrNo) [protected, virtual]

Keep track of whether or not we have registered with the fire manager for notification of fire and detonations for under-fire processing.

virtual void DtUnderFireDeterminationSensor::setUnderFire ( const DtFireContext fireContext) [protected, virtual]

Sets the under fire and the "last time fired upon" in the state repository.

virtual void DtUnderFireDeterminationSensor::clearUnderFire ( ) [protected, virtual]

Sets the under-fire state in the state repository to false.

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

assignment operator; not implemented


Member Data Documentation


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)