|
VR-Engage
2.2
|
The DtArtPartParamToStateAttrMap component enables a user to map DIS articulated part parameter values to state attributes. This allows the application to access and use articulation values (such as turret azimuth, gun elevation, etc.) from DIS simulation entities through the standard state attribute system.
Example Lua configuration:
#include <artPartParamToStateAttrMap.h>
Public Member Functions | |
| DtArtPartParamToStateAttrMap () | |
| virtual | ~DtArtPartParamToStateAttrMap () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual bool | postInitialize () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Types | |
| using | ArtPartParamStateAttrDescriptor |
Protected Member Functions | |
| virtual makVre::DtVreMessageResult | handleSimState (makVre::DtVreMessage *msg) |
| virtual void | shutdown () override |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| std::map< int, ArtPartParamStateAttrDescriptor > | myArtPartParameterMap |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
Structure defining mapping between an articulated part parameter and a state attribute.
| makVre::DtArtPartParamToStateAttrMap::DtArtPartParamToStateAttrMap | ( | ) |
Constructor for DtArtPartParamToStateAttrMap.
Initializes the component with the name "DtArtPartParamToStateAttrMap".
|
overridevirtual |
Virtual destructor for DtArtPartParamToStateAttrMap.
|
overridevirtual |
Initializes the component with configuration from Lua.
Processes the provided configuration to create mappings between articulated part types, parameter types, and state attribute names. Also registers a handler for simulation state messages.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing initialization parameters, especially the artPartParameters table |
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Updates the component state (empty implementation)
This method is called each frame, but currently has no implementation for this component.
| dt | Delta time in seconds since the last tick |
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
protectedvirtual |
Handles simulation state messages.
Processes simulation state messages to extract articulated part parameters and updates corresponding state attributes based on the configured mappings.
| msg | The simulation state message to process |
|
overrideprotectedvirtual |
Shuts down the component.
Removes the simulation state message handler.
Reimplemented from makVre::DtPlayerComponent.
|
protected |
Map of art part type to parameter/state attribute descriptor.
The map keys are DIS articulated part type enumeration values, and the values are ArtPartParamStateAttrDescriptor structures.