|
VR-Engage
2.2
|
The DtArtPartUpdater monitors specified articulated parts of the engaged entity. For each configured part, it provides two state attributes:
This component is particularly useful for quickly determining states such as whether doors are open/closed or other articulated parts are in specific positions.
Example Lua configuration:
#include <artPartUpdater.h>
Public Member Functions | |
| DtArtPartUpdater () | |
| virtual | ~DtArtPartUpdater () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual void | tick (double dt) 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 | partVars |
Protected Member Functions | |
| virtual void | setHasPartAttribute (std::string partLabel, bool value) |
| virtual makVre::DtVreMessageResult | handleSimState (makVre::DtVreMessage *msg) |
| virtual DtVreMessageResult | handleMenuMessage (makVre::DtVreMessage *msg) |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| std::map< int, partVars > | myParts |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
|
protected |
Structure defining parameters for monitoring an articulated part.
| makVre::DtArtPartUpdater::DtArtPartUpdater | ( | ) |
Constructor for DtArtPartUpdater.
Initializes the component with the name "DtArtPartUpdater".
|
overridevirtual |
Virtual destructor for DtArtPartUpdater.
|
overridevirtual |
Initializes the component with configuration from Lua.
Processes the provided configuration to set up monitoring for specified articulated parts. Creates state attributes for each part and registers handlers for simulation state and menu action messages.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing initialization parameters, especially the artParts 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.
|
protectedvirtual |
Sets the has[PartName] attribute in the state repository.
Creates or updates a state attribute of the form "has[PartName]" with the provided boolean value. The first character of the part label is capitalized in the attribute name.
| partLabel | The label of the articulated part |
| value | The boolean value to set for the attribute |
|
protectedvirtual |
Handles simulation state messages.
Processes simulation state messages to extract articulated part information and updates corresponding state attributes based on the configured mappings. For each configured part that exists, sets has[PartName]=true and updates [partName]State based on the comparison with the threshold value.
| msg | The simulation state message to process |
|
protectedvirtual |
Handles menu action messages.
Processes menu action messages specifically for the "cargoDoor" action. Based on the current cargoDoorState, sends appropriate entity task messages to open or close the cargo ramp.
| msg | The menu action message to process |
|
overrideprotectedvirtual |
Shuts down the component.
Removes the simulation state and menu action message handlers.
Reimplemented from makVre::DtPlayerComponent.
|
overrideprotectedvirtual |
Returns the component type identifier.
Implements makVre::DtPlayerComponent.
|
protected |
Map of art part IDs to their monitoring parameters.
The map keys are DIS articulated part type enumeration values, and the values are partVars structures.