VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtArtPartParamToStateAttrMap Class Reference

Detailed Description

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:

["artPartParamToStateAttrMap"] = {
componentType = "DtArtPartParamToStateAttrMap";
priority = 5;
artPartParameters = {
{artPartType = 4096, parameterType = 10, stateAttributeName = "primaryTurretAzimuth"};
{artPartType = 4416, parameterType = 12, stateAttributeName = "primaryGunElevation"};
};
};

#include <artPartParamToStateAttrMap.h>

Inheritance diagram for makVre::DtArtPartParamToStateAttrMap:
[legend]

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 DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () 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, ArtPartParamStateAttrDescriptormyArtPartParameterMap
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Member Typedef Documentation

◆ ArtPartParamStateAttrDescriptor

Initial value:
{
int parameterType;
std::string stateAttributeName;
}
struct ArtPartParamStateAttrDescriptor { int parameterType; std::string stateAttributeName; } ArtPartParamStateAttrDescriptor
Structure defining mapping between an articulated part parameter and a state attribute.
Definition artPartParamToStateAttrMap.h:105

Structure defining mapping between an articulated part parameter and a state attribute.

Constructor & Destructor Documentation

◆ DtArtPartParamToStateAttrMap()

makVre::DtArtPartParamToStateAttrMap::DtArtPartParamToStateAttrMap ( )

Constructor for DtArtPartParamToStateAttrMap.

Initializes the component with the name "DtArtPartParamToStateAttrMap".

◆ ~DtArtPartParamToStateAttrMap()

virtual makVre::DtArtPartParamToStateAttrMap::~DtArtPartParamToStateAttrMap ( )
overridevirtual

Virtual destructor for DtArtPartParamToStateAttrMap.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtArtPartParamToStateAttrMap::initialize ( makVre::DtPlayerStation * player,
makVre::DtInitTable & config )
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.

Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing initialization parameters, especially the artPartParameters table
Returns
True if initialization succeeds, false otherwise

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ tick()

virtual void makVre::DtArtPartParamToStateAttrMap::tick ( double dt)
overridevirtual

Updates the component state (empty implementation)

This method is called each frame, but currently has no implementation for this component.

Parameters
dtDelta time in seconds since the last tick

Implements makVre::DtPlayerComponent.

◆ type()

virtual const char * makVre::DtArtPartParamToStateAttrMap::type ( ) const
overridevirtual

Returns the type identifier for this component.

Returns
The type string for DtArtPartParamToStateAttrMap

Implements makVre::DtPlayerComponent.

◆ handleSimState()

virtual makVre::DtVreMessageResult makVre::DtArtPartParamToStateAttrMap::handleSimState ( makVre::DtVreMessage * msg)
protectedvirtual

Handles simulation state messages.

Processes simulation state messages to extract articulated part parameters and updates corresponding state attributes based on the configured mappings.

Parameters
msgThe simulation state message to process
Returns
HANDLED if the message was successfully processed

◆ shutdown()

virtual void makVre::DtArtPartParamToStateAttrMap::shutdown ( )
overrideprotectedvirtual

Shuts down the component.

Removes the simulation state message handler.

Reimplemented from makVre::DtPlayerComponent.

Member Data Documentation

◆ myArtPartParameterMap

std::map<int, ArtPartParamStateAttrDescriptor> makVre::DtArtPartParamToStateAttrMap::myArtPartParameterMap
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.


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