VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtPlayerComponent Class Referenceabstract

Detailed Description

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>

Inheritance diagram for makVre::DtPlayerComponent:
[legend]

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 DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Member Functions

virtual void initializeStateAttributes ()
 

Protected Attributes

std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtPlayerComponent()

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.

◆ ~DtPlayerComponent()

virtual makVre::DtPlayerComponent::~DtPlayerComponent ( )
virtual

Virtual destructor.

Ensures proper cleanup of derived component classes.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtPlayerComponent::initialize ( DtPlayerStation * player,
DtInitTable & config )
virtual

Initializes the component.

Parameters
playerPointer to the player station that owns this component
configConfiguration table with component settings
Returns
True if initialization was successful, false otherwise

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().

◆ postInitialize()

virtual bool makVre::DtPlayerComponent::postInitialize ( )
virtual

Performs post-initialization setup.

Returns
True if post-initialization was successful, false otherwise

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.

◆ tick()

virtual void makVre::DtPlayerComponent::tick ( double dt)
pure virtual

Updates the component.

Parameters
dtTime 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.

◆ shutdown()

virtual void makVre::DtPlayerComponent::shutdown ( )
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.

◆ type()

virtual const char * makVre::DtPlayerComponent::type ( ) const
pure virtual

Gets the component type identifier.

Returns
Reference to the component type string

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").

Note
This is a pure virtual method that must be implemented by all derived classes.

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.

◆ setName()

virtual void makVre::DtPlayerComponent::setName ( const std::string & name)
virtual

Sets the component name.

Parameters
nameThe 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().

◆ name()

virtual const std::string & makVre::DtPlayerComponent::name ( )
virtual

Gets the component name.

Returns
Reference to the component name string

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().

◆ player()

virtual DtPlayerStation & makVre::DtPlayerComponent::player ( )
virtual

Gets the player station.

Returns
Reference to the player station that owns this component

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().

◆ playerAttributeStore() [1/2]

virtual DtAttributeHandle & makVre::DtPlayerComponent::playerAttributeStore ( )
virtual

Gets the player attribute store.

Returns
Reference to the attribute store

Provides access to the attribute store of the player station, which contains shared data that can be accessed by all components.

◆ playerAttributeStore() [2/2]

virtual const DtAttributeHandle & makVre::DtPlayerComponent::playerAttributeStore ( ) const
virtual

Gets the player attribute store (const version)

Returns
Const reference to the attribute store

◆ initializeStateAttributes()

virtual void makVre::DtPlayerComponent::initializeStateAttributes ( )
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.

Member Data Documentation

◆ myName

std::string makVre::DtPlayerComponent::myName
protected

Component instance name.

◆ myConfig

DtInitTable makVre::DtPlayerComponent::myConfig
protected

Component configuration table.

◆ myPlayer

DtPlayerStation* makVre::DtPlayerComponent::myPlayer
protected

Pointer to the owning player station.

◆ myDe

makVrv::DtDe* makVre::DtPlayerComponent::myDe
protected

Pointer to the display engine (common to all components)

◆ myResolver

DtEntityResolver* makVre::DtPlayerComponent::myResolver
protected

Pointer to the entity resolver (common to all components)

◆ myAttributeCallbacks

DtAttributeCallbackManager makVre::DtPlayerComponent::myAttributeCallbacks
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.


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