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 | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtDiGuyController Class Reference

Controls appearances and animations for an entity that is represented by a DI-Guy 3D visual representation.

End User Description: This controller is used on entities that have a DI-Guy driven 3D visual representation. This controller enables Set tasks for DI-Guy appearances and animations, and handles set/task messages by sending out special DI-Guy control messages to the visual system. In the case of DI-Guy animations, this controller will suppress movement by a normal actuator and move the the entity directly in line with the selected animation. Uses Descriptor Type: DtComponentDescriptor

Further notes: Controls a DtHumanStateRepository (DtVrfMovingObjectStateRepository) instance. This is a "local" state repository.

Inheritance diagram for DtDiGuyController:
Inheritance graph
[legend]

Public Member Functions

 DtDiGuyController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtDiGuyController ()
 
virtual const chartype () const
 
virtual bool init ()
 
virtual bool createPSR ()
 
virtual void preFirstTickInit ()
 
virtual void tick ()
 
virtual void taskedTick (DtTime &dT)
 
virtual bool intrinsicOverride ()
 
virtual bool tickWhileDestroyed () const
 
virtual void setCurrentAnimation (const DtDiGuyAnimation *animation)
 
virtual void sendSetPosture (DtLifeformState post)
 
virtual void processSetCharacterCharacteristics (DtSimMessage *msg)
 
virtual void processSetCharacterAppearance (DtSimMessage *msg)
 
virtual void processSetCharacterHandItem (DtSimMessage *msg)
 
virtual void processSetCharacterHead (DtSimMessage *msg)
 
virtual void processSetUnitPatches (DtSimMessage *msg)
 
virtual void processSetRankPatch (DtSimMessage *msg)
 
virtual void processSetNametag (DtSimMessage *msg)
 
virtual void processSetRestore (DtSimMessage *msg)
 
virtual void processSetAdjustDemeanor (DtSimMessage *msg)
 
virtual void processAnimationTask (DtSimMessage *msg)
 
virtual void clearTask ()
 
virtual void taskComplete (bool success=true)
 
virtual void reset ()
 
virtual DtDiGuyDirectionType directionStringToEnum (const DtString &direction)
 
virtual void bindLuaFunctions (lua_State *L)
 
virtual void bindLuaGlobals (lua_State *L)
 
Update & Action choosing methods.

Call hierarchy: tick(): intrinsicTick -> updateDemeanorAndPosture. updateDemeanorAndPosture updateAnimationState: lookupTimeToStop: chooseAnimation -> DtDiGuyIntrinsicAnimationMap::findClosestAnimation chooseAnimation -> DtDiGuyIntrinsicAnimationMap::findClosestAnimation

virtual bool intrinsicTick (DtWeaponState weaponState, DtDamageState damageState, DtLifeformStaticPosture &posture, DtString &demeanor, double speed)
 
virtual double lookupTimeToStop (DtWeaponState weaponState, DtDamageState damageState, DtLifeformStaticPosture post, const DtString &demeanor, double heading) const
 
virtual const DtDiGuyAnimationchooseAnimation (DtWeaponState weaponState, DtDamageState damageState, DtLifeformStaticPosture post, const DtString &demeanor, double speed, double heading, bool debug=true) const
 
virtual void updateAnimationState (DtWeaponState weapon, DtDamageState damageState, DtLifeformStaticPosture posture, const DtString &demeanor, double speed)
 
bool isAnimationAvailable (const std::string &animation) const
 
bool isAppearanceAvailable (const std::string &appearance) const
 
bool isHandItemAvailable (const std::string &item) const
 
bool isHeadAvailable (const std::string &head) const
 
bool isGestureAvailable (const std::string &gesture) const
 
- Public Member Functions inherited from DtSingleTaskControllerComponent
 DtSingleTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtSingleTaskControllerComponent ()
 
virtual void postTick () override
 
virtual bool beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState) override
 
virtual void taskNotify (const DtSimTask &task) override
 
virtual void suspendTask ()
 
virtual int sendSubtask (DtSimTask &task)
 
virtual void clearSubtask (int subtaskId)
 
virtual void addPendingSubtaskId (int subtaskId)
 
virtual bool findPendingSubtaskId (int subtaskId)
 
virtual bool isSubtasked () const
 
virtual void removePendingSubtaskId (int subtaskId)
 
virtual void removeAllPendingSubtaskIds ()
 
virtual std::vector< intcurrentPendingSubstaskIds () const
 
virtual DtSubtaskStatusEntrysubtaskStatus (int subtaskId)
 
virtual void clearCurrentTaskMessage ()
 
virtual DtTaskMessagecurrentTaskMessage () const
 
virtual DtSimTaskStatePtr currentTaskState () const
 
virtual bool decideToGiveUpTask () const
 
virtual void giveUpTask ()
 
virtual bool taskActive (int taskId) const override
 
virtual bool clearTopLevelTasks () override
 
virtual void clearConflictingTopLevelTasks (const DtSimTaskMessageType &conflictType) override
 
virtual void clearTasksByType (const DtSimTaskMessageType &taskType) override
 
virtual void clearTaskById (int taskId) override
 
virtual DtSuspendedTaskInfosuspendTaskById (int taskId) override
 
virtual DtSuspendedTaskInfosuspendSubtaskById (int taskId, int subtaskId) override
 
virtual std::list
< DtTaskMessage * > 
currentTaskMessages () const
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const override
 
virtual void disable () override
 
- Public Member Functions inherited from DtTaskControllerComponent
 DtTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtTaskControllerComponent ()
 
virtual AcceptLevel acceptTask (const DtTaskMessage &task)
 
virtual bool showCurrentTaskInGui () const
 
virtual void setRadio (DtSimRadio *radio) override
 
virtual void registerTaskMsgCallbacks ()
 
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 
virtual void enable () override
 
virtual void sendTaskCanceled (DtTaskMessage *taskMsg)
 
virtual bool taskVisualizationsActive () const override
 
virtual void setTasked (bool tasked)
 
virtual bool tasked () const
 
- Public Member Functions inherited from DtControllerComponent
 DtControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtControllerComponent ()
 
virtual bool postAddComponentsInit () override
 
virtual DtSimRadioradio ()
 
virtual void enableTaskTypes ()
 
virtual void enableScriptedTask (const DtString &scriptId)
 
virtual void disableTaskTypes ()
 
- Public Member Functions inherited from DtSimComponent
 DtSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSimComponent ()
 
virtual void setParentSystem (DtComponentSystem *system)
 
DtComponentSystemparentSystem () const
 
virtual void registerAttributeFunctions ()
 
virtual void timedTick ()
 
virtual void setMinTickPeriod (double minTickPeriod, double minTickPeriodVariance)
 
virtual void setupFirstTickTime ()
 
virtual void setEntity (DtLocalObject *entity)
 
virtual DtSimComponentnextComponent ()
 
virtual DtSimComponentprevComponent ()
 
virtual void setListItem (DtListItem *item)
 
virtual DtListItem * listItem ()
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual void addInputPort (DtInputPort *port)
 
virtual void removeInputPort (DtInputPort *port)
 
virtual DtInputPortlookupInputPort (const DtString &portName)
 
virtual DtList inputPortList () const
 
virtual void addOutputPort (DtOutputPort *port)
 
virtual void removeOutputPort (DtOutputPort *port)
 
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 
virtual DtList outputPortList () const
 
virtual void addInputPortGroup (DtInputPortGroup *group)
 
virtual void removeInputPortGroup (DtInputPortGroup *group)
 
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 
virtual DtList inputPortGroupList () const
 
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
 
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 
virtual DtList outputPortGroupList () const
 
virtual int priority () const
 
virtual void setPriority (int priority)
 
double dT () const
 
virtual void setDT (double deltaT)
 
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 
virtual const
DtComponentDescriptor
componentDescriptor () const
 
DtVrfProcessStateRepositoryManagerpsrManager ()
 
virtual const DtSymbolStringcomponentFullName () const
 
DtPhysicalWorldphysicalWorld ()
 
const DtPhysicalWorldphysicalWorld () const
 
const DtAttachedTerrainterrainAttachedTo () const
 
DtLocalObjectentity ()
 
const DtLocalObjectentity () const
 
DtSimulationServicessimulationServices ()
 
const DtSimulationServicessimulationServices () const
 
const Coordinate_SystemcoordinateSystem () const
 
virtual void isClutterChanged ()
 
virtual bool taskVisualizationsEnabled () const
 
makVrf::DtTaskVisualizationMaptaskVisualizations ()
 
virtual bool isEnabled ()
 
virtual void setIsEnabled (bool yesNo)
 
virtual DtOutputStream & objectConsoleDebug (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleVerbose (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleInfo (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleWarn (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleError (const DtString &channel="") const
 
virtual int notifyLevel () const
 
virtual DtSimResourceManagerresourceManager ()
 
virtual const
DtSimResourceManager
resourceManager () const
 
VRF4API_METHOD const
DtSimulationServices
simManager () const
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs) const
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
virtual void postGetSelf ()
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charreaderWriterType () const
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 
- Public Member Functions inherited from DtBindableLuaComponent< DtDiGuyController >
 DtBindableLuaComponent (DtLocalObject *entity, const DtString &componentName, const DtString &componentType)
 
virtual ~DtBindableLuaComponent ()
 
bool shouldBind (lua_State *L) const
 
- Public Member Functions inherited from DtBindableLuaComponentInterface
 DtBindableLuaComponentInterface (DtLocalObject *entity, const DtString &componentName, const DtString &componentType)
 
virtual ~DtBindableLuaComponentInterface ()
 
virtual void bind (DtLocalObject *, const DtString &scriptId, lua_State *)
 
virtual DtString bindableName (const DtString &) const
 

Static Public Member Functions

static void setCharacteristicsCallback (DtSimMessage *msg, void *usr)
 
static void setAppearanceCallback (DtSimMessage *msg, void *usr)
 
static void setHandItemCallback (DtSimMessage *msg, void *usr)
 
static void setHeadCallback (DtSimMessage *msg, void *usr)
 
static void setUnitPatchesCallback (DtSimMessage *msg, void *usr)
 
static void setRankPatchCallback (DtSimMessage *msg, void *usr)
 
static void setNametagCallback (DtSimMessage *msg, void *usr)
 
static void setRestoreCallback (DtSimMessage *msg, void *usrData)
 
static void setAdjustDemeanorCallback (DtSimMessage *msg, void *usrData)
 
static void animationTaskCallback (DtSimMessage *msg, void *usrData)
 
static DtSimComponentcreator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
- Static Public Member Functions inherited from DtTaskControllerComponent
static void deprecatedTaskProcessorCallbackAdapter (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState)
 
- Static Public Member Functions inherited from DtSimComponent
static DtSimComponentFactoryfactory ()
 
static void setFactory (DtSimComponentFactory *factory)
 
static DtSimComponentcreateComponent (const DtString &name, const DtString &type, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentSystem *parentSystem, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
static void addSimComponentCreatorFcn (const DtString &type, DtSimComponentCreatorFcn fcn)
 
static VRF4API_METHOD
DtSimComponent
MarkThreadSafe (DtSimComponent *comp)
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 

Protected Member Functions

virtual void registerRadioMessageCallbacks ()
 
virtual void registerDiGuyTasks ()
 
virtual void determineInitialHandItem ()
 
virtual DtVector groundClamp (double heading, const DtVector &location) const
 
 DtDiGuyController ()
 
 DtDiGuyController (const DtDiGuyController &orig)
 
const DtDiGuyControlleroperator= (const DtDiGuyController &orig)
 
virtual bool createPortGroups ()
 
virtual bool createPorts ()
 
virtual bool createCollisionPort ()
 
virtual bool createAimDirectionPort ()
 
virtual bool createOrderedAnimationPort ()
 
virtual bool createOrderedHandItemPort ()
 
virtual bool createEtaToDestinationInputPort ()
 
virtual bool createChangingPosturePort ()
 
virtual bool createNegateSpeedPort ()
 
void checkAndSetDefaultPatches ()
 
virtual void updateDemeanorAndPosture (DtWeaponState weaponState, DtDamageState damageState, DtLifeformStaticPosture &posture, DtString &demeanor)
 
virtual void determineDirection ()
 
virtual DtString chooseRandomAppearance ()
 
virtual void updatePosition (const DtTime &dT, DtTaitBryan &localOrientation)
 
virtual DtString selectDamageAnimation (const DtRwNLengthStringVector &animations)
 
virtual void initializeAdjustedDemeanorMap ()
 
virtual double diGuyHeading () const
 
- Protected Member Functions inherited from DtSingleTaskControllerComponent
virtual void clearPendingSubtasks ()
 
virtual void clearSubtasksByType (const DtSimTaskMessageType &taskType)
 
virtual void cleanupInactiveSubtaskStatus ()
 
- Protected Member Functions inherited from DtTaskControllerComponent
virtual void suspendSubtasksOfTask (int taskId, DtSuspendedTaskInfo *suspendInfo)
 
virtual void suspendSubtaskOfTask (int taskId, int subtaskId, DtSuspendedTaskInfo *suspendInfo)
 
virtual DtSimTaskMessageType remapScriptId (const DtSimTaskMessageType &) const
 
- Protected Member Functions inherited from DtControllerComponent
 DtControllerComponent ()
 
 DtControllerComponent (const DtControllerComponent &orig)
 
const DtControllerComponentoperator= (const DtControllerComponent &orig)
 
virtual void onRestore ()
 
virtual void initializeTargetingControlTableFromDescriptor (const DtReaderWriter *)
 
virtual void sendCapableSetsAndTasks ()
 
- Protected Member Functions inherited from DtSimComponent
virtual void setupTimedTickLogic (double minTickPeriod, double minTickPeriodVariance)
 
virtual double computeCurrentTime ()
 
bool testInvariant () const
 
DtVrfProcessStateRepositorycreateComponentPsr (const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
 
virtual void updateTaskVisualizations ()
 
virtual void destroyTaskVisualizations ()
 
virtual void destroyTaskVisualization (const DtString &name)
 
virtual
makVrf::DtPointTaskVisualizationPtr 
pointTaskVisualization (const DtString &name)
 
virtual
makVrf::DtLineTaskVisualizationPtr 
lineTaskVisualization (const DtString &name)
 
virtual
makVrf::DtAreaTaskVisualizationPtr 
areaTaskVisualization (const DtString &name)
 
virtual
makVrf::DtTextTaskVisualizationPtr 
textTaskVisualization (const DtString &name)
 
double calculateNextTaskVisTickTime () const
 
DtVrfObjectStateRepositorylocalStateRepository ()
 
const DtVrfObjectStateRepositorylocalStateRepository () const
 
DtPropertyInterfacecachedNextFrameStateProperty (DtPropertyInterface **prop, const DtString &propName)
 
template<typename ValType >
void setCachedNextFrameStatePropertyValue (DtPropertyInterface **prop, const DtString &propName, ValType value)
 
const DtPropertyInterfacecachedCurrentFrameStateProperty (const DtPropertyInterface **prop, const DtString &propName) const
 
template<typename ValType >
bool getCachedCurrentFrameStatePropertyValue (const DtPropertyInterface **prop, const DtString &propName, ValType &value) const
 
void addSimObjectPredicateCallback (DtSimObjectReference, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void removeSimObjectPredicateCallback (const DtSimObject *, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void invokeSimObjectPredicateCallbacks ()
 
virtual void clearPredicateCallbacks ()
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Protected Attributes

const DtDiGuyControllerDescriptormyDiGuyDescriptor
 
const DtDiGuyCharacterDatamyCharacterData
 
DtVrfMovingObjectStateRepositorymyLocalState
 
const DtDiGuyAnimationmyDefaultAnimation
 
DtLifeformStaticPosture myDefaultAnimationPosture
 
bool myTaskInterrupted
 
const DtDiGuyAnimationmyTaskedAnimation
 
DtTaitBryan myTaskedOrientation
 
const DtDiGuyAnimationmyCurrentAnimation
 
DtWeaponState myCurrentAnimationWeaponState
 
DtDamageState myCurrentDamageState
 
DtLifeformStaticPosture myCurrentAnimationPosture
 
double myCurrentAnimationSpeed
 
std::pair< DtString, doublemyLastTimeToStop
 
double myAnimationDuration
 
DtTime myTimeElapsed
 
bool myAmRotating
 
double myDirectionOfMovement
 
DtDiGuyControllerPSRmyProcessState
 
DtBooleanInputPortmyCollisionPort
 
DtAnalogInputPortmyAimDirectionPort
 
DtStringInputPortmyOrderedAnimationPort
 
DtStringInputPortmyOrderedHandItemPort
 
DtAnalogInputPortmyEtaToDestinationInputPort
 
DtBooleanOutputPortmyIsChangingPosturePort
 
DtBooleanInputPortmyNegateSpeedPort
 
bool myAmTransitioningPosture
 
double myTransitionTime
 
double myCurrentHeading
 
DtUpdateRepositoryOutputPortGroupmyUpdateRepositoryOutputPortGroup
 
bool myTickWhileDead
 
bool myNeedUpdate
 
bool myAmOrdered
 
int myLastPosition
 
DtDemeanorToRankMap myDemeanorRankMap
 
DtHumanLocalObjectFacade myHumanLocalObjectFacade
 
bool myForceAnimationUpdate
 
- Protected Attributes inherited from DtTaskControllerComponent
DtTaskCallbackMap myTaskCallbackMap
 
std::list
< DtTaskProcessorCallbackInfo * > 
myTaskProcessorCallbackInfoList
 
bool myTaskIsRunning
 
- Protected Attributes inherited from DtControllerComponent
DtSimRadiomyRadio
 
bool myTaskTypesEnabled
 
bool myInitialized
 
- Protected Attributes inherited from DtSimComponent
DtLocalObjectmyEntity
 
DtComponentSystemmySystem
 
DtListItem * myListItem
 
DtInputPortMap myInputPortList
 
DtOutputPortMap myOutputPortList
 
DtInputPortGroupMap myInputPortGroupList
 
DtOutputPortGroupMap myOutputPortGroupList
 
int myPriority
 
double myLastTickSimTime
 
std::unique_ptr< DtTimedTickLogicmyTimedTickLogic
 
double myDT
 
bool myIsEnabled
 
bool myFirstTick
 
const DtComponentDescriptormyComponentDescriptor
 
std::list
< DtVrfProcessStateRepository * > 
myComponentPsrs
 
makVrf::DtTaskVisualizationMap myTaskVisualizations
 
double myNextTaskVisTickTime
 
DtSymbolString myFullComponentName
 
DtSimulationServicesmySimServices
 
DtPredicateCallbackManagermyPredicateCallbackManager
 
boost::signals2::scoped_connection myIsClutterChangedConnection
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 
- Protected Attributes inherited from DtBindableLuaComponentInterface
DtLocalObjectmyBoundEntity
 
lua_State * myBoundForState
 
DtString myType
 

Additional Inherited Members

- Public Types inherited from DtTaskControllerComponent
enum  AcceptLevel { AcceptLevel_Accept = 0, AcceptLevel_Partial = 1, AcceptLevel_Error = 2, AcceptLevel_NoAccept = 99 }
 
- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
 
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
 
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
 
typedef std::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 
- Protected Types inherited from DtTaskControllerComponent
typedef std::pair
< DtTaskMessageCallbackFcn,
void * > 
DtTaskCallbackMapPair
 
typedef std::map
< DtSimTaskMessageType,
DtTaskCallbackMapPair
DtTaskCallbackMap
 
- Protected Types inherited from DtSimComponent
typedef std::map< DtString,
DtInputPort * > 
DtInputPortMap
 
typedef std::map< DtString,
DtOutputPort * > 
DtOutputPortMap
 
typedef std::map< DtString,
DtInputPortGroup * > 
DtInputPortGroupMap
 
typedef std::map< DtString,
DtOutputPortGroup * > 
DtOutputPortGroupMap
 
- Static Protected Attributes inherited from DtSimComponent
static DtSimComponentFactorymyFactory
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Constructor & Destructor Documentation

DtDiGuyController::DtDiGuyController ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject 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).
virtual DtDiGuyController::~DtDiGuyController ( )
virtual

destructor

DtDiGuyController::DtDiGuyController ( )
protected

Not implemented.

DtDiGuyController::DtDiGuyController ( const DtDiGuyController orig)
protected

Not implemented.

Member Function Documentation

virtual const char* DtDiGuyController::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. Warning: this function should always return the same pointer and it should be valid forever. This means the data should be static.

Returns
DtDiGuyControllerType

Implements DtTaskControllerComponent.

virtual bool DtDiGuyController::init ( )
virtual

Initialize the component. Calls registerRadioMessageCallbacks()

Reimplemented from DtControllerComponent.

virtual bool DtDiGuyController::createPSR ( )
virtual

Creates myProcessState data member, and adds it to our process state repository manager. Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.

virtual void DtDiGuyController::preFirstTickInit ( )
virtual

Sets up myCharacterData, myCurrentAnimation, myTaskedAnimation, myDefaultAnimation, myDdefaultAnimationPosture, myTimeElapsed, myAnimationDuration, myAmRotating and myDirectionOfMovement.

Reimplemented from DtSimComponent.

virtual void DtDiGuyController::tick ( )
virtual

Calculate new control values.

Reimplemented from DtSimComponent.

virtual void DtDiGuyController::taskedTick ( DtTime dT)
virtual

Called if we are tasked to perform an animation. Disables the movement actuator so that position and velocity settings are controlled from this controller. Updates the position and velocity each tick.

virtual bool DtDiGuyController::intrinsicOverride ( )
virtual

Checks if there's some intrinsic behavior like collision avoidance or shooting the enemy that needs to break in and happen during a tasked animation.

virtual bool DtDiGuyController::tickWhileDestroyed ( ) const
virtual
Returns
true.

Reimplemented from DtSimComponent.

virtual void DtDiGuyController::setCurrentAnimation ( const DtDiGuyAnimation animation)
virtual

Added an override posture for cases where the diguy animation's posture doesn't accurately reflect the entity's real posture–I.e. parachuting and fast roping.

virtual void DtDiGuyController::sendSetPosture ( DtLifeformState  post)
virtual

Sends out our animation's posture when we're finished performing the animation so the actuator knows what the ending posture was and doesn't revert to an old posture.

static void DtDiGuyController::setCharacteristicsCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes a command to set the DI-Guy characteristics.

virtual void DtDiGuyController::processSetCharacterCharacteristics ( DtSimMessage msg)
virtual
static void DtDiGuyController::setAppearanceCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes a command to set the DI-Guy appearance.

virtual void DtDiGuyController::processSetCharacterAppearance ( DtSimMessage msg)
virtual
static void DtDiGuyController::setHandItemCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes a command to set the DI-Guy hand item.

virtual void DtDiGuyController::processSetCharacterHandItem ( DtSimMessage msg)
virtual
static void DtDiGuyController::setHeadCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes a command to set the DI-Guy head.

virtual void DtDiGuyController::processSetCharacterHead ( DtSimMessage msg)
virtual
static void DtDiGuyController::setUnitPatchesCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes a command to set the DI-Guy unit patches.

virtual void DtDiGuyController::processSetUnitPatches ( DtSimMessage msg)
virtual
static void DtDiGuyController::setRankPatchCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes a command to set the DI-Guy rank patch.

virtual void DtDiGuyController::processSetRankPatch ( DtSimMessage msg)
virtual
static void DtDiGuyController::setNametagCallback ( DtSimMessage msg,
void *  usr 
)
static

Processes a command to set the DI-Guy nametag.

virtual void DtDiGuyController::processSetNametag ( DtSimMessage msg)
virtual
static void DtDiGuyController::setRestoreCallback ( DtSimMessage msg,
void *  usrData 
)
static
virtual void DtDiGuyController::processSetRestore ( DtSimMessage msg)
virtual
static void DtDiGuyController::setAdjustDemeanorCallback ( DtSimMessage msg,
void *  usrData 
)
static

Processes a command to adjust the demeanor.

virtual void DtDiGuyController::processSetAdjustDemeanor ( DtSimMessage msg)
virtual
static void DtDiGuyController::animationTaskCallback ( DtSimMessage msg,
void *  usrData 
)
static
virtual void DtDiGuyController::processAnimationTask ( DtSimMessage msg)
virtual
virtual void DtDiGuyController::clearTask ( )
virtual

Both call reset to clear out the tasked animation, set the posture correctly and release control of movement and posture to the other movement components.

Reimplemented from DtSingleTaskControllerComponent.

virtual void DtDiGuyController::taskComplete ( bool  success = true)
virtual

If we are currently tasked, this will cause us to notify the entity that we're done and delete the task. To indicate that the task has failed (and is being abandoned) call this method with success set to false.

Reimplemented from DtSingleTaskControllerComponent.

virtual void DtDiGuyController::reset ( )
virtual

For those reader/writer items that support it, resets the reader/writer value to original state Default is no-op.

Reimplemented from DtReaderWriter.

virtual bool DtDiGuyController::intrinsicTick ( DtWeaponState  weaponState,
DtDamageState  damageState,
DtLifeformStaticPosture posture,
DtString demeanor,
double  speed 
)
virtual

When the entity is not tasked to perform an animation, this controller looks at the entity's current weapon and damage state to determine if the entity needs an update and the demeanor (eg. dead, aiming, sick) and posture to use to determine the best animation for the entity.

virtual double DtDiGuyController::lookupTimeToStop ( DtWeaponState  weaponState,
DtDamageState  damageState,
DtLifeformStaticPosture  post,
const DtString demeanor,
double  heading 
) const
virtual

Determine how long the current animation will take to stop.

virtual const DtDiGuyAnimation* DtDiGuyController::chooseAnimation ( DtWeaponState  weaponState,
DtDamageState  damageState,
DtLifeformStaticPosture  post,
const DtString demeanor,
double  speed,
double  heading,
bool  debug = true 
) const
virtual

Chooses which animation to use for the given posture, speed, weapon state, and demeanor.

virtual void DtDiGuyController::updateAnimationState ( DtWeaponState  weapon,
DtDamageState  damageState,
DtLifeformStaticPosture  posture,
const DtString demeanor,
double  speed 
)
virtual

Updates the animation in the underlying local state repository using ::chooseAnimation().

virtual DtDiGuyDirectionType DtDiGuyController::directionStringToEnum ( const DtString direction)
virtual

Given a DI-Guy direction string return the enum that goes with it.

bool DtDiGuyController::isAnimationAvailable ( const std::string &  animation) const

Methods accessible via Lua extensions. These are deprecated but remain for backwards compatibility. It is recommended you use the DtScriptVrfObject functions for these purposes.

Returns true if the specified animation is available for this entity.

bool DtDiGuyController::isAppearanceAvailable ( const std::string &  appearance) const

Returns true if the specified appearance is available for this entity.

bool DtDiGuyController::isHandItemAvailable ( const std::string &  item) const

Returns true if the specified hand item is available for this entity.

bool DtDiGuyController::isHeadAvailable ( const std::string &  head) const

Returns true if the specified head is available for this entity and its current body appearance.

bool DtDiGuyController::isGestureAvailable ( const std::string &  gesture) const

Returns true if the specified gesture is available for this entity.

virtual void DtDiGuyController::bindLuaFunctions ( lua_State *  L)
virtual

Binds method for this class to the lua state. This simple method will send an object console message to the entity that implements this task.

Implements DtBindableLuaComponentInterface.

virtual void DtDiGuyController::bindLuaGlobals ( lua_State *  )
virtual

Override to bind lua globals.

Implements DtBindableLuaComponentInterface.

static DtSimComponent* DtDiGuyController::creator ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)
static

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject 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).
Returns
New instance of this class.
virtual void DtDiGuyController::registerRadioMessageCallbacks ( )
protectedvirtual

Registers for setCharacterAppearanceDataRequest from the local entity's radio.

virtual void DtDiGuyController::registerDiGuyTasks ( )
protectedvirtual

Registers for animation tasks. Called from preFirstTickInit.

virtual void DtDiGuyController::determineInitialHandItem ( )
protectedvirtual

Attempts to correct the initial hand item. Can be an issue when loading older scenarios where hand item was saved as part of the appearance.

virtual DtVector DtDiGuyController::groundClamp ( double  heading,
const DtVector location 
) const
protectedvirtual
const DtDiGuyController& DtDiGuyController::operator= ( const DtDiGuyController orig)
protected

Not implemented.

virtual bool DtDiGuyController::createPortGroups ( )
protectedvirtual

Overridden to create local port groups.

Reimplemented from DtSimComponent.

virtual bool DtDiGuyController::createPorts ( )
protectedvirtual

Overridden to create the local ports.

Reimplemented from DtSimComponent.

virtual bool DtDiGuyController::createCollisionPort ( )
protectedvirtual

These are called in init to create the ports used to communicate with the controller.

virtual bool DtDiGuyController::createAimDirectionPort ( )
protectedvirtual
virtual bool DtDiGuyController::createOrderedAnimationPort ( )
protectedvirtual
virtual bool DtDiGuyController::createOrderedHandItemPort ( )
protectedvirtual
virtual bool DtDiGuyController::createEtaToDestinationInputPort ( )
protectedvirtual
virtual bool DtDiGuyController::createChangingPosturePort ( )
protectedvirtual
virtual bool DtDiGuyController::createNegateSpeedPort ( )
protectedvirtual
void DtDiGuyController::checkAndSetDefaultPatches ( )
protected

If patches are unknown, they're probably defaults, and we're using the default appearance. document why default appearance doesn't get patches here.

virtual void DtDiGuyController::updateDemeanorAndPosture ( DtWeaponState  weaponState,
DtDamageState  damageState,
DtLifeformStaticPosture posture,
DtString demeanor 
)
protectedvirtual

Update the Determine the demeanor to use when choosing actions based on the given weapon state and posture.

virtual void DtDiGuyController::determineDirection ( )
protectedvirtual

Work out the value of myDirectionOfMovement (see below)

virtual DtString DtDiGuyController::chooseRandomAppearance ( )
protectedvirtual
virtual void DtDiGuyController::updatePosition ( const DtTime dT,
DtTaitBryan &  localOrientation 
)
protectedvirtual

Only relevant during a tasked animation.

virtual DtString DtDiGuyController::selectDamageAnimation ( const DtRwNLengthStringVector animations)
protectedvirtual
virtual void DtDiGuyController::initializeAdjustedDemeanorMap ( )
protectedvirtual
virtual double DtDiGuyController::diGuyHeading ( ) const
protectedvirtual

Returns heading of DI-Guy depending on whether or not embarked.

Member Data Documentation

const DtDiGuyControllerDescriptor* DtDiGuyController::myDiGuyDescriptor
protected
const DtDiGuyCharacterData* DtDiGuyController::myCharacterData
protected
DtVrfMovingObjectStateRepository* DtDiGuyController::myLocalState
protected
const DtDiGuyAnimation* DtDiGuyController::myDefaultAnimation
protected
DtLifeformStaticPosture DtDiGuyController::myDefaultAnimationPosture
protected
bool DtDiGuyController::myTaskInterrupted
protected
const DtDiGuyAnimation* DtDiGuyController::myTaskedAnimation
protected
DtTaitBryan DtDiGuyController::myTaskedOrientation
protected
const DtDiGuyAnimation* DtDiGuyController::myCurrentAnimation
protected
DtWeaponState DtDiGuyController::myCurrentAnimationWeaponState
protected
DtDamageState DtDiGuyController::myCurrentDamageState
protected
DtLifeformStaticPosture DtDiGuyController::myCurrentAnimationPosture
protected
double DtDiGuyController::myCurrentAnimationSpeed
protected
std::pair<DtString,double> DtDiGuyController::myLastTimeToStop
mutableprotected

Cached time required to stop from current action. Lookup method is const, but we want to be able to cache the value to avoid costly lookup so this is mutable.

double DtDiGuyController::myAnimationDuration
protected

These values are stored in the PSR Do we want this animation to be performed only once? Indefinitely? Or for a specified period of time? some number in seconds;.

DtTime DtDiGuyController::myTimeElapsed
protected
bool DtDiGuyController::myAmRotating
protected
double DtDiGuyController::myDirectionOfMovement
protected

This is an angle, in radians, relative to the current heading (a value of PI represents "backwards"). If the character is moving, but not rotating, this value is used to determine its velocity. If the character is rotating, it represents a target to get to.

DtDiGuyControllerPSR* DtDiGuyController::myProcessState
protected

Container for state data associated with this component. This state is saved and restored as part of a scenario (or checkpoint).

DtBooleanInputPort* DtDiGuyController::myCollisionPort
protected

Input Port Name: collision
Input Port Description: Checks to see if we're avoiding a collision. Overrides DI-Guy tasked animations. Need to avoid collisions first.
Input Port Range:
Input Port Default Value:
Input Group Parent:

DtAnalogInputPort* DtDiGuyController::myAimDirectionPort
protected

Input Port Name: aim-direction
Input Port Description: Specifies the heading in which the entity should aim its weapon. This information will override DI-Guy Tasked animations.
Input Port Range: Heading value in radians.
Input Port Default Value: N/A
Input Group Parent:

DtStringInputPort* DtDiGuyController::myOrderedAnimationPort
protected

Input Port Name: ordered-animation
Input Port Description: Specifies an animation to be used as long as the entity is not currently tasked to perform another animation.
Input Port Default Value:
.

DtStringInputPort* DtDiGuyController::myOrderedHandItemPort
protected

Input Port Name: ordered-hand-item
Input Port Description: Specifies a hand item to be used.
Input Port Default Value:
.

DtAnalogInputPort* DtDiGuyController::myEtaToDestinationInputPort
protected

Input Port Name: eta-to-last-vertex
Input Port Description: Specifies the eta to reach the last vertex of the entity's route. Input Port Range:
Input Group Parent:
.

DtBooleanOutputPort* DtDiGuyController::myIsChangingPosturePort
protected

Output Port Name: is-changing-posture
Output Port Description: Indicates that the DI Guy character is currently changing posture.
Output Port Range: true or false
Output Port Default Value: false.

DtBooleanInputPort* DtDiGuyController::myNegateSpeedPort
protected

Input Port Name: is-action-speed-negated
Input Port Description: Indicates that the speed used for action choosing should be negated. The speed is usually directionless, but for choosing 'reverse' actions, the choosing logic needs to know whether to pick a forward or reverse action. Other controllers can use this port to specify that.
Input Port Range: true or false
Input Port Default Value: false.

bool DtDiGuyController::myAmTransitioningPosture
protected

Local flag for we know we're changing posture.

double DtDiGuyController::myTransitionTime
protected

The remaining time for the current posture transition. Gets decremented in tick()

double DtDiGuyController::myCurrentHeading
protected

The last heading for the entity. Will be used when setting animation for rotating on the spot.

DtUpdateRepositoryOutputPortGroup* DtDiGuyController::myUpdateRepositoryOutputPortGroup
protected

Used to update repository with any movement data. As long as this controller has control of this port group no other controllers/actuators will be allowed to write to it.

bool DtDiGuyController::myTickWhileDead
protected
bool DtDiGuyController::myNeedUpdate
protected
bool DtDiGuyController::myAmOrdered
protected
int DtDiGuyController::myLastPosition
protected
DtDemeanorToRankMap DtDiGuyController::myDemeanorRankMap
protected
DtHumanLocalObjectFacade DtDiGuyController::myHumanLocalObjectFacade
protected

Member to allow for access to human specific data.

bool DtDiGuyController::myForceAnimationUpdate
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)