|
VR-Engage
2.2
|
The DtGlStudioHudMapperLogic handles configuration and management of cockpit displays and instrument panels created with GLStudio. It supports:
This component works in conjunction with GLStudio to provide a complete cockpit visualization system for vehicle roles.
#include <glstudioHudMapperLogic.h>
Public Member Functions | |
| DtGlStudioHudMapperLogic () | |
| virtual | ~DtGlStudioHudMapperLogic () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () 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 Member Functions | |
| virtual void | createInstrumentPanels (makVre::DtInitTable &config) |
| virtual makVre::DtVreMessageResult | handleGlsConfigRequest (makVre::DtVreMessage *msg) |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| std::vector< std::string > | myModelDefinitions |
| std::map< std::string, DtInitTable > | myPanelConfigurations |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtGlStudioHudMapperLogic::DtGlStudioHudMapperLogic | ( | ) |
Constructor for DtGlStudioHudMapperLogic.
Initializes the component with the name "DtGlStudioHudMapperLogic" and empty model definitions and panel configurations.
|
overridevirtual |
Virtual destructor for DtGlStudioHudMapperLogic.
|
overridevirtual |
Initializes the component with configuration from Lua.
Sets up the model definitions for cockpit displays, processes instrument panel configurations, and adds a handler for GLStudio configuration requests. The method also sets the "realCockpit" state attribute based on configuration.
Configuration parameters include:
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing initialization parameters |
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.
| dt | Delta time in seconds since the last tick |
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the component.
Closes all instrument panels associated with this entity by sending a WindowOperationMessage with the OperationType_Destroy operation. Also removes the GLStudio configuration request handler.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the component type identifier.
Implements makVre::DtPlayerComponent.
|
protectedvirtual |
Creates instrument panels used by the current display layout.
Processes the "instrumentPanels" section from the configuration and creates instrument panels with the specified properties. For each panel, sends a WindowOperationMessage to create a new instrument panel window with the specified parameters.
Panel configuration parameters include:
| config | Configuration table containing instrument panel settings |
|
protectedvirtual |
Handles configuration requests from GLStudio components.
Processes GlsConfigRequestMessages by looking up the requested panel ID in the myPanelConfigurations map. If found, sends a GlsConfigResponseMessage with the panel's properties.
Properties are defined in the "properties" section of a panel's configuration as key-value pairs.
| msg | The message to process (expected to be a GlsConfigRequestMessage) |
|
protected |
List of model definitions for cockpit displays.
These model definitions are registered with the DtSharedCockpitSettings to map entity types to cockpit models.
|
protected |
Map of panel IDs to their configuration data.
This map stores initialization data for instrument panels, allowing the component to respond to panel configuration requests. The key is the panel ID, and the value is the configuration table containing the panel's properties.
An empty string key represents the main cockpit display's configuration.