|
VR-Engage
2.2
|
DtPlayerComponent serves as the foundation for all components that can be added to player roles. Components encapsulate specific functionality, such as movement control, weapons systems, sensor management, and user interface elements.
Components are instantiated by the player station during initialization based on the role definition. They have access to the player attribute store for sharing data with other components, and they receive tick calls for regular updates.
#include <playerComponent.h>
Public Member Functions | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) |
| virtual bool | postInitialize () |
| virtual void | tick (double dt)=0 |
| virtual void | shutdown () |
| virtual const char * | type () const =0 |
| 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 | initializeStateAttributes () |
Protected Attributes | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtPlayerComponent::DtPlayerComponent | ( | ) |
Constructor.
Creates a component Called from DtPlayerStation::initializeComponents during player station initialization. Each component has a unique type that identifies its functionality.
|
virtual |
Virtual destructor.
Ensures proper cleanup of derived component classes.
|
virtual |
Initializes the component.
| player | Pointer to the player station that owns this component |
| config | Configuration table with component settings |
Called when the component is first created during player station initialization. This method performs initial setup and calls initializeStateAttributes(). Components should override this method to perform type-specific initialization, but must call the base class implementation first.
Reimplemented in DtDriverQmlHudComponent, DtEntityDetectionControlLogic, DtHumanAudioUpdater, DtHumanWeaponPoseLogic, DtLightsSirensControlLogic, DtNotifyLogic, DtPilotObserverUpdater, DtPlayerStateAttributeSampleComponent, DtStreamingVideoUpdater, DtVehicleBlinkerControlLogic, DtVrObserverUpdater, makVre::DtActionMenuLogic, makVre::DtActionMenuUpdater, makVre::DtAppLauncherComponent, makVre::DtArtPartParamToStateAttrMap, makVre::DtArtPartUpdater, makVre::DtAudioListenerOverrideUpdater, makVre::DtAudioUpdater, makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, makVre::DtBinocularsSimLogic, makVre::DtBinocularsZoomOverlay, makVre::DtCigiHostControl, makVre::DtCommanderControlLogic, makVre::DtCommanderHatchControlLogic, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtCommentLogic, makVre::DtDeadReckonOverrider, makVre::DtDeployableObjectsSimLogic, makVre::DtDisembarkControlLogic, makVre::DtDriverControlLogic, makVre::DtDriverMenuLogic, makVre::DtDroneHudUpdater, makVre::DtEchelonLogic, makVre::DtEngineAudioUpdater, makVre::DtEntityControlLogic, makVre::DtExtendedStateLogic, makVre::DtFriendlyUnitsLogic, makVre::DtGlStudioHudMapperLogic, makVre::DtGunnerControlLogic, makVre::DtGunnerObserverUpdater, makVre::DtGunnerRangeSimLogic, makVre::DtHudUpdater, makVre::DtHumanControlLogic, makVre::DtHumanHudUpdater, makVre::DtHumanMenuLogic, makVre::DtHumanObserverUpdater, makVre::DtHumanRenderUpdater, makVre::DtHumanVirtualRealityLogic, makVre::DtHumanVrHudUpdater, makVre::DtLaserTargetDesignatorSimLogic, makVre::DtLookAroundObserverUpdater, makVre::DtMetaRoleControlLogic, makVre::DtMinimapUpdater, makVre::DtMixedRealityUpdater, makVre::DtObserverUpdater, makVre::DtOverlayComponent, makVre::DtPilotMenuLogic, makVre::DtPilotRenderUpdater, makVre::DtPilotSimLogic, makVre::DtQtQuickOverlay, makVre::DtRadioLogic, makVre::DtRoleSelectionControl, makVre::DtSavedViewUpdater, makVre::DtScopeSimLogic, makVre::DtScriptComponent, makVre::DtSettingsOverrideComponent, makVre::DtSlewToCueControl, makVre::DtSpectatorAudioUpdater, makVre::DtSpectatorHudUpdater, makVre::DtSpectatorObserverUpdater, makVre::DtSpectatorOverlay, makVre::DtSpectatorSimLogic, makVre::DtVehicleOccupantUpdater, makVre::DtVirtualRealityLogic, makVre::DtVrvSensorOverlayUpdater, makVre::DtWeaponPoseUpdater, makVre::DtWeaponResourceLogic, makVre::DtWindowLayoutComponent, and makVre::DtZoomControl.
References player().
|
virtual |
Performs post-initialization setup.
Called after all components have been created and initialized. This is when required but not owned state attributes can be looked up in the state, or dependent components can be located. Components can use this phase to establish connections with other components in the player station.
Reimplemented in DtDriverQmlHudComponent, DtPlayerStateAttributeSampleComponent, makVre::DtActionMenuLogic, makVre::DtActionMenuUpdater, makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, makVre::DtBinocularsSimLogic, makVre::DtBinocularsZoomOverlay, makVre::DtCommanderControlLogic, makVre::DtCommanderHatchControlLogic, makVre::DtDeadReckonOverrider, makVre::DtDeployableObjectsSimLogic, makVre::DtDriverMenuLogic, makVre::DtEntityControlLogic, makVre::DtFriendlyUnitsLogic, makVre::DtGunnerControlLogic, makVre::DtHudUpdater, makVre::DtHumanControlLogic, makVre::DtHumanHudUpdater, makVre::DtHumanMenuLogic, makVre::DtHumanObserverUpdater, makVre::DtHumanVirtualRealityLogic, makVre::DtHumanVrHudUpdater, makVre::DtLookAroundObserverUpdater, makVre::DtMetaRoleControlLogic, makVre::DtMinimapUpdater, makVre::DtMixedRealityUpdater, makVre::DtObserverUpdater, makVre::DtOverlayComponent, makVre::DtPilotMenuLogic, makVre::DtPilotRenderUpdater, makVre::DtQtQuickOverlay, makVre::DtRadioLogic, makVre::DtRoleSelectionControl, makVre::DtScopeSimLogic, makVre::DtScriptComponent, makVre::DtSlewToCueControl, and makVre::DtWeaponResourceLogic.
|
pure virtual |
Updates the component.
| dt | Time in seconds since the last tick |
Called once per frame to update the component's state. All concrete component classes must implement this method.
Implemented in DtDriverQmlHudComponent, DtEntityDetectionControlLogic, DtHumanAudioUpdater, DtHumanWeaponPoseLogic, DtLightsSirensControlLogic, DtNotifyLogic, DtPilotObserverUpdater, DtPlayerStateAttributeSampleComponent, DtStreamingVideoUpdater, DtVrObserverUpdater, makVre::DtActionMenuLogic, makVre::DtActionMenuUpdater, makVre::DtAppLauncherComponent, makVre::DtArtPartParamToStateAttrMap, makVre::DtArtPartUpdater, makVre::DtAudioListenerOverrideUpdater, makVre::DtAudioUpdater, makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, makVre::DtBinocularsSimLogic, makVre::DtBinocularsZoomOverlay, makVre::DtCigiHostControl, makVre::DtCommanderControlLogic, makVre::DtCommanderHatchControlLogic, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtCommentLogic, makVre::DtDeadReckonOverrider, makVre::DtDeployableObjectsSimLogic, makVre::DtDisembarkControlLogic, makVre::DtDriverControlLogic, makVre::DtDriverMenuLogic, makVre::DtDroneHudUpdater, makVre::DtEchelonLogic, makVre::DtEngineAudioUpdater, makVre::DtEntityControlLogic, makVre::DtExtendedStateLogic, makVre::DtFriendlyUnitsLogic, makVre::DtGlStudioHudMapperLogic, makVre::DtGunnerControlLogic, makVre::DtGunnerObserverUpdater, makVre::DtGunnerRangeSimLogic, makVre::DtHudUpdater, makVre::DtHumanControlLogic, makVre::DtHumanHudUpdater, makVre::DtHumanMenuLogic, makVre::DtHumanObserverUpdater, makVre::DtHumanRenderUpdater, makVre::DtHumanVirtualRealityLogic, makVre::DtHumanVrHudUpdater, makVre::DtLaserTargetDesignatorSimLogic, makVre::DtLookAroundObserverUpdater, makVre::DtMetaRoleControlLogic, makVre::DtMinimapUpdater, makVre::DtMixedRealityUpdater, makVre::DtObserverUpdater, makVre::DtOverlayComponent, makVre::DtPilotMenuLogic, makVre::DtPilotRenderUpdater, makVre::DtPilotSimLogic, makVre::DtQtQuickOverlay, makVre::DtRadioLogic, makVre::DtRoleSelectionControl, makVre::DtSavedViewUpdater, makVre::DtScopeSimLogic, makVre::DtScriptComponent, makVre::DtSettingsOverrideComponent, makVre::DtSlewToCueControl, makVre::DtSpectatorAudioUpdater, makVre::DtSpectatorHudUpdater, makVre::DtSpectatorObserverUpdater, makVre::DtSpectatorOverlay, makVre::DtSpectatorSimLogic, makVre::DtVehicleOccupantUpdater, makVre::DtVirtualRealityLogic, makVre::DtVrvSensorOverlayUpdater, makVre::DtWeaponPoseUpdater, makVre::DtWeaponResourceLogic, and makVre::DtWindowLayoutComponent.
|
virtual |
Shuts down the component.
Called when the player station is shutting down. Components should override this method to release resources and perform cleanup operations.
Reimplemented in DtDriverQmlHudComponent, DtEntityDetectionControlLogic, DtHumanAudioUpdater, DtHumanWeaponPoseLogic, DtLightsSirensControlLogic, DtNotifyLogic, DtPilotObserverUpdater, DtPlayerStateAttributeSampleComponent, DtStreamingVideoUpdater, DtVrObserverUpdater, makVre::DtActionMenuLogic, makVre::DtActionMenuUpdater, makVre::DtAppLauncherComponent, makVre::DtArtPartParamToStateAttrMap, makVre::DtArtPartUpdater, makVre::DtAudioListenerOverrideUpdater, makVre::DtAudioUpdater, makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, makVre::DtBinocularsSimLogic, makVre::DtCigiHostControl, makVre::DtCommanderControlLogic, makVre::DtCommanderHatchControlLogic, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtCommentLogic, makVre::DtDeadReckonOverrider, makVre::DtDeployableObjectsSimLogic, makVre::DtDisembarkControlLogic, makVre::DtDriverControlLogic, makVre::DtDriverMenuLogic, makVre::DtEchelonLogic, makVre::DtEngineAudioUpdater, makVre::DtEntityControlLogic, makVre::DtExtendedStateLogic, makVre::DtFriendlyUnitsLogic, makVre::DtGlStudioHudMapperLogic, makVre::DtGunnerControlLogic, makVre::DtGunnerObserverUpdater, makVre::DtGunnerRangeSimLogic, makVre::DtHudUpdater, makVre::DtHumanControlLogic, makVre::DtHumanMenuLogic, makVre::DtHumanObserverUpdater, makVre::DtHumanRenderUpdater, makVre::DtHumanVirtualRealityLogic, makVre::DtHumanVrHudUpdater, makVre::DtLaserTargetDesignatorSimLogic, makVre::DtLookAroundObserverUpdater, makVre::DtMetaRoleControlLogic, makVre::DtMinimapUpdater, makVre::DtMixedRealityUpdater, makVre::DtObserverUpdater, makVre::DtOverlayComponent, makVre::DtPilotMenuLogic, makVre::DtPilotRenderUpdater, makVre::DtPilotSimLogic, makVre::DtQtQuickOverlay, makVre::DtRadioLogic, makVre::DtRoleSelectionControl, makVre::DtSavedViewUpdater, makVre::DtScopeSimLogic, makVre::DtScriptComponent, makVre::DtSettingsOverrideComponent, makVre::DtSlewToCueControl, makVre::DtSpectatorAudioUpdater, makVre::DtSpectatorHudUpdater, makVre::DtSpectatorObserverUpdater, makVre::DtSpectatorOverlay, makVre::DtSpectatorSimLogic, makVre::DtVehicleOccupantUpdater, makVre::DtVirtualRealityLogic, makVre::DtVrvSensorOverlayUpdater, makVre::DtWeaponPoseUpdater, makVre::DtWeaponResourceLogic, makVre::DtWindowLayoutComponent, and makVre::DtZoomControl.
|
pure virtual |
Gets the component type identifier.
Returns the unique type identifier for this component class. The type string is used by the component system to identify and instantiate components based on role configuration. Each component class should return a consistent, descriptive type name (e.g., "DtDriverControlLogic", "DtObserverUpdater").
Implemented in DtDriverQmlHudComponent, DtEntityDetectionControlLogic, DtHumanAudioUpdater, DtHumanWeaponPoseLogic, DtLightsSirensControlLogic, DtNotifyLogic, DtPilotObserverUpdater, DtPlayerStateAttributeSampleComponent, DtStreamingVideoUpdater, DtVehicleBlinkerControlLogic, DtVrObserverUpdater, makVre::DtActionMenuLogic, makVre::DtActionMenuUpdater, makVre::DtAppLauncherComponent, makVre::DtArtPartParamToStateAttrMap, makVre::DtArtPartUpdater, makVre::DtAudioListenerOverrideUpdater, makVre::DtAudioUpdater, makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, makVre::DtBinocularsSimLogic, makVre::DtBinocularsZoomOverlay, makVre::DtCigiHostControl, makVre::DtCommanderControlLogic, makVre::DtCommanderHatchControlLogic, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtCommentLogic, makVre::DtDeadReckonOverrider, makVre::DtDeployableObjectsSimLogic, makVre::DtDisembarkControlLogic, makVre::DtDriverControlLogic, makVre::DtDriverMenuLogic, makVre::DtDroneHudUpdater, makVre::DtEchelonLogic, makVre::DtEngineAudioUpdater, makVre::DtEntityControlLogic, makVre::DtExtendedStateLogic, makVre::DtFriendlyUnitsLogic, makVre::DtGlStudioHudMapperLogic, makVre::DtGunnerControlLogic, makVre::DtGunnerObserverUpdater, makVre::DtGunnerRangeSimLogic, makVre::DtHudUpdater, makVre::DtHumanControlLogic, makVre::DtHumanHudUpdater, makVre::DtHumanMenuLogic, makVre::DtHumanObserverUpdater, makVre::DtHumanRenderUpdater, makVre::DtHumanVirtualRealityLogic, makVre::DtHumanVrHudUpdater, makVre::DtLaserTargetDesignatorSimLogic, makVre::DtLookAroundObserverUpdater, makVre::DtMetaRoleControlLogic, makVre::DtMinimapUpdater, makVre::DtMixedRealityUpdater, makVre::DtObserverUpdater, makVre::DtOverlayComponent, makVre::DtPilotMenuLogic, makVre::DtPilotRenderUpdater, makVre::DtPilotSimLogic, makVre::DtQtQuickOverlay, makVre::DtRadioLogic, makVre::DtRoleSelectionControl, makVre::DtSavedViewUpdater, makVre::DtScopeSimLogic, makVre::DtScriptComponent, makVre::DtSettingsOverrideComponent, makVre::DtSlewToCueControl, makVre::DtSpectatorAudioUpdater, makVre::DtSpectatorHudUpdater, makVre::DtSpectatorObserverUpdater, makVre::DtSpectatorOverlay, makVre::DtSpectatorSimLogic, makVre::DtVehicleOccupantUpdater, makVre::DtVirtualRealityLogic, makVre::DtVrvSensorOverlayUpdater, makVre::DtWeaponPoseUpdater, makVre::DtWeaponResourceLogic, makVre::DtWindowLayoutComponent, and makVre::DtZoomControl.
|
virtual |
Sets the component name.
| name | The name to assign to this component |
Sets a name for this component instance, which can be used to distinguish between multiple components of the same type in a player station.
References name().
|
virtual |
Gets the component name.
Returns the name of this component instance, which may be empty if no name was explicitly assigned.
Referenced by makVre::DtOverlayComponent::findTextByName(), makVre::DtActionMenuLogic::hideMenu(), setName(), makVre::DtOverlayComponent::setTextVisible(), makVre::DtActionMenuLogic::showMenu(), and makVre::DtHumanControlLogic::showQmlOverlay().
|
virtual |
Gets the player station.
Provides access to the player station that this component belongs to.
Referenced by DtDriverQmlHudComponent::initialize(), DtEntityDetectionControlLogic::initialize(), DtHumanAudioUpdater::initialize(), DtHumanWeaponPoseLogic::initialize(), DtLightsSirensControlLogic::initialize(), DtNotifyLogic::initialize(), DtPilotObserverUpdater::initialize(), DtPlayerStateAttributeSampleComponent::initialize(), DtStreamingVideoUpdater::initialize(), DtVehicleBlinkerControlLogic::initialize(), DtVrObserverUpdater::initialize(), makVre::DtActionMenuLogic::initialize(), makVre::DtActionMenuUpdater::initialize(), makVre::DtArtPartParamToStateAttrMap::initialize(), makVre::DtArtPartUpdater::initialize(), makVre::DtAudioListenerOverrideUpdater::initialize(), makVre::DtAudioUpdater::initialize(), makVre::DtBinocularsLasingOverlay::initialize(), makVre::DtBinocularsOverlay::initialize(), makVre::DtBinocularsSimLogic::initialize(), makVre::DtBinocularsZoomOverlay::initialize(), makVre::DtCigiHostControl::initialize(), makVre::DtCommanderControlLogic::initialize(), makVre::DtCommanderHatchControlLogic::initialize(), makVre::DtCommanderHatchViewUpdater::initialize(), makVre::DtCommanderObserverUpdater::initialize(), makVre::DtCommentLogic::initialize(), makVre::DtDeadReckonOverrider::initialize(), makVre::DtDeployableObjectsSimLogic::initialize(), makVre::DtDisembarkControlLogic::initialize(), makVre::DtDriverControlLogic::initialize(), makVre::DtDriverMenuLogic::initialize(), makVre::DtDroneHudUpdater::initialize(), makVre::DtEchelonLogic::initialize(), makVre::DtEngineAudioUpdater::initialize(), makVre::DtEntityControlLogic::initialize(), makVre::DtExtendedStateLogic::initialize(), makVre::DtFriendlyUnitsLogic::initialize(), makVre::DtGlStudioHudMapperLogic::initialize(), makVre::DtGunnerControlLogic::initialize(), makVre::DtGunnerObserverUpdater::initialize(), makVre::DtGunnerRangeSimLogic::initialize(), makVre::DtHudUpdater::initialize(), makVre::DtHumanControlLogic::initialize(), makVre::DtHumanHudUpdater::initialize(), makVre::DtHumanMenuLogic::initialize(), makVre::DtHumanObserverUpdater::initialize(), makVre::DtHumanRenderUpdater::initialize(), makVre::DtHumanVirtualRealityLogic::initialize(), makVre::DtHumanVrHudUpdater::initialize(), makVre::DtLaserTargetDesignatorSimLogic::initialize(), makVre::DtLookAroundObserverUpdater::initialize(), makVre::DtMetaRoleControlLogic::initialize(), makVre::DtMinimapUpdater::initialize(), makVre::DtMixedRealityUpdater::initialize(), makVre::DtOverlayComponent::initialize(), makVre::DtPilotMenuLogic::initialize(), makVre::DtPilotRenderUpdater::initialize(), makVre::DtPilotSimLogic::initialize(), initialize(), makVre::DtQtQuickOverlay::initialize(), makVre::DtRadioLogic::initialize(), makVre::DtRoleSelectionControl::initialize(), makVre::DtSavedViewUpdater::initialize(), makVre::DtScopeSimLogic::initialize(), makVre::DtScriptComponent::initialize(), makVre::DtSettingsOverrideComponent::initialize(), makVre::DtSlewToCueControl::initialize(), makVre::DtSpectatorAudioUpdater::initialize(), makVre::DtSpectatorHudUpdater::initialize(), makVre::DtSpectatorObserverUpdater::initialize(), makVre::DtSpectatorOverlay::initialize(), makVre::DtSpectatorSimLogic::initialize(), makVre::DtVehicleOccupantUpdater::initialize(), makVre::DtVirtualRealityLogic::initialize(), makVre::DtVrvSensorOverlayUpdater::initialize(), makVre::DtWeaponPoseUpdater::initialize(), makVre::DtWeaponResourceLogic::initialize(), and makVre::DtZoomControl::initialize().
|
virtual |
Gets the player attribute store.
Provides access to the attribute store of the player station, which contains shared data that can be accessed by all components.
|
virtual |
Gets the player attribute store (const version)
|
protectedvirtual |
Initializes component state attributes.
Creates and initializes any player state attributes required by this component. Derived component classes should override this method if they need to add custom state attributes to the player attribute store.
Reimplemented in makVre::DtActionMenuUpdater, makVre::DtCigiHostControl, makVre::DtEchelonLogic, makVre::DtFriendlyUnitsLogic, makVre::DtObserverUpdater, and makVre::DtRadioLogic.
|
protected |
Component instance name.
|
protected |
Component configuration table.
|
protected |
Pointer to the owning player station.
|
protected |
Pointer to the display engine (common to all components)
|
protected |
Pointer to the entity resolver (common to all components)
|
protected |
Member-scope instance of Attribute callback manager.
Used to manage Attribute change callback connections and ensure that all callbacks are unregistered when this class instance is destroyed.