|
VR-Engage
2.2
|
DtVehicleOccupantUpdater manages the visibility of vehicle occupant models (visual-only representations of drivers in vehicles) when a player assumes a driver role. It caches the current occupant visibility state when a player first takes control and restores that state when the player relinquishes control. During player control, the component ensures the occupant is visible to external observers while hiding it locally for the player to prevent visual obstructions.
#include <vehicleOccupantUpdater.h>
Public Member Functions | |
| DtVehicleOccupantUpdater () | |
| virtual | ~DtVehicleOccupantUpdater () override |
| virtual bool | initialize (DtPlayerStation *player, 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 | showDriverOccupantExternally () |
| virtual void | hideDriverOccupantExternally () |
| virtual void | hideDriverOccupantLocally () |
| virtual void | showDriverOccupantLocally () |
| virtual void | cacheOccupantState () |
| virtual void | restoreOccupantState () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| bool | myPlayerIsImplicitDriver |
| bool | myCachedOccupantState |
| bool | myInitialHideOccupantsState |
| makVrv::DtObserver * | myObserver |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtVehicleOccupantUpdater::DtVehicleOccupantUpdater | ( | ) |
Constructor for DtVehicleOccupantUpdater.
Initializes the component with default state values
|
overridevirtual |
Virtual destructor for DtVehicleOccupantUpdater.
|
overridevirtual |
Initializes the vehicle occupant updater component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing component settings |
Determines whether the player is an implicit driver (directly controlling a vehicle) versus an embarked driver (a human player that entered a vehicle)
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Called every frame to update the occupant visibility state.
| dt | Delta time since the last frame in seconds |
If the player is an implicit driver, this function waits until it can detect the "HideOccupants" state. Once detected, it performs the following actions once:
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the vehicle occupant updater component.
Restores the driver occupant model locally and resets the published "HideOccupants" state of the vehicle to its original value
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
protectedvirtual |
Makes the driver occupant visible to external observers.
Sends an internal message indicating that the driver occupant for the vehicle should be visible. This ensures that other simulators and observers will see the driver model in the vehicle.
|
protectedvirtual |
Makes the driver occupant visible to external observers.
Sends an internal message indicating that the driver occupant for the vehicle should be hidden. This ensures that other simulators and observers will hide the driver model in the vehicle.
|
protectedvirtual |
Hides the driver occupant model in the local view.
Sends a message to hide the occupant model locally, preventing it from obstructing the player's view while driving
|
protectedvirtual |
Shows the driver occupant model in the local view.
Sends a message to make the occupant model visible locally, typically called during shutdown to restore the original state
|
protectedvirtual |
Saves the original occupant visibility state.
Reads and caches the initial "HideOccupants" attribute value to allow proper restoration during shutdown
|
protectedvirtual |
Restores the original occupant visibility state.
Sends an internal message to reset the vehicle's occupant visibility to match the cached value from before player engagement
|
protected |
Flag indicating if player is directly controlling the vehicle (not embarked)
|
protected |
Flag indicating if the initial occupant state has been cached.
|
protected |
The initial value of the HideOccupants attribute.
|
protected |
Pointer to the observer being used by this component.