DtVreEmbarkationController extends the base embarkation controller with VRE-specific functionality. It manages the embarkation and disembarkation of entities into and out of vehicles or other carrier entities. This controller includes fixes for VRF bugs such as lifeforms staying in sitting posture while moving to egress points, and adds additional capabilities for weapon state management during embarkation operations.
#include <vreEmbarkationController.h>
|
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| |
◆ DtVreEmbarkationController() [1/3]
| makVre::DtVreEmbarkationController::DtVreEmbarkationController |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc = 0, |
|
|
DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
- Parameters
-
| name | The name of this component |
| owner | The local object that owns this component |
| simManager | The simulation services manager |
| desc | Component descriptor with configuration parameters |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new embarkation controller component with the specified parameters.
Referenced by DtVreEmbarkationController(), and operator=().
◆ ~DtVreEmbarkationController()
| virtual makVre::DtVreEmbarkationController::~DtVreEmbarkationController |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the embarkation controller component, including any signal connections.
◆ DtVreEmbarkationController() [2/3]
| makVre::DtVreEmbarkationController::DtVreEmbarkationController |
( |
| ) |
|
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
◆ DtVreEmbarkationController() [3/3]
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtVreEmbarkationController().
◆ type()
| virtual const char * makVre::DtVreEmbarkationController::type |
( |
| ) |
const |
|
overridevirtual |
Gets the type identifier for this component.
- Returns
- String identifying the component type (DtVreEmbarkationControllerType)
Implements the DtSimComponent::type() method to return the type identifier for this component.
◆ creator()
| static DtSimComponent * makVre::DtVreEmbarkationController::creator |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc = 0, |
|
|
DtReaderWriterRegistry * | parentRegistry = 0 ) |
|
static |
Factory method to create a new instance of this component.
- Parameters
-
| name | The name for the new component |
| owner | The local object that will own this component |
| simManager | The simulation services manager |
| desc | Optional component descriptor |
| parentRegistry | Optional parent registry for reader/writer functionality |
- Returns
- Pointer to the newly created component
Static factory method used by the component creation system to instantiate new instances of this component type.
◆ tick()
| virtual void makVre::DtVreEmbarkationController::tick |
( |
| ) |
|
|
overrideprotectedvirtual |
Updates the controller state each simulation frame.
Checks for slot position changes, updates postures during embarkation and disembarkation, and fixes the VRF bug where lifeforms stay sitting while moving to egress points.
◆ preFirstTickInit()
| virtual void makVre::DtVreEmbarkationController::preFirstTickInit |
( |
| ) |
|
|
overrideprotectedvirtual |
Performs initialization before the first simulation tick.
Sets up initial states and caches references to required components before the simulation begins. This includes setting up the VRE-specific embarkation process state repository.
◆ init()
| virtual bool makVre::DtVreEmbarkationController::init |
( |
| ) |
|
|
overrideprotectedvirtual |
Initializes the embarkation controller.
- Returns
- True if initialization is successful, false otherwise
Overridden to register callback for object deleted signals, which are needed to properly handle cases where the carrier entity is deleted while this entity is embarked.
◆ completeEmbarkationInformationRequest()
| virtual void makVre::DtVreEmbarkationController::completeEmbarkationInformationRequest |
( |
const DtIfEmbarkationInformation * | embarkInfo | ) |
|
|
overrideprotectedvirtual |
Handles embarkation information receipt and clearance to embark.
- Parameters
-
| embarkInfo | Pointer to embarkation information for the target slot |
Called when embarkation information has been received and the entity has been cleared to embark. Overridden to provide VRE-specific handling of embarkation operations, including weapon state management.
◆ completeDisembarkationInformationRequest()
| virtual void makVre::DtVreEmbarkationController::completeDisembarkationInformationRequest |
( |
const DtIfEmbarkationInformation * | disembarkInfo | ) |
|
|
overrideprotectedvirtual |
Handles disembarkation information receipt and clearance to disembark.
- Parameters
-
| disembarkInfo | Pointer to disembarkation information for the egress point |
Called when disembarkation information has been received and the entity has been cleared to disembark. Overridden to provide VRE-specific handling of disembarkation operations, including restoring cached weapon states.
◆ fallbackOffloadPoint()
| virtual DtVector makVre::DtVreEmbarkationController::fallbackOffloadPoint |
( |
| ) |
|
|
overrideprotectedvirtual |
Provides a fallback disembarkation position.
- Returns
- Vector containing the fallback offload point coordinates
Overridden to offer a better fallback disembarkation position when the normal disembarkation process cannot determine a suitable egress point. This improves the reliability of the disembarkation process.
◆ updateLifeformEmbarkedAppearanceAndAnimation()
| virtual void makVre::DtVreEmbarkationController::updateLifeformEmbarkedAppearanceAndAnimation |
( |
int | slotNum, |
|
|
const DtString & | animationHintName ) |
|
overrideprotectedvirtual |
Updates lifeform appearance and animation when embarked.
- Parameters
-
| slotNum | The embarkation slot number |
| animationHintName | Animation hint for the embarked state |
Overridden to include weapon state management from slot appearance settings. Ensures the correct appearance and animation when an entity is embarked in a vehicle or other carrier entity.
◆ cacheWeaponState()
| virtual void makVre::DtVreEmbarkationController::cacheWeaponState |
( |
| ) |
|
|
protectedvirtual |
Caches the current weapon state before embarkation.
Stores the current weapon state and hand item information before embarkation, so it can be restored later when the entity disembarks. This ensures continuity of equipment across embarkation operations.
◆ restoreWeaponState()
| virtual void makVre::DtVreEmbarkationController::restoreWeaponState |
( |
| ) |
|
|
protectedvirtual |
Restores the cached weapon state after disembarkation.
Restores the previously cached weapon state and hand item after disembarkation. This ensures the entity returns to its proper equipped state after leaving a vehicle or other carrier entity.
◆ processSimObjectDeleted()
| virtual void makVre::DtVreEmbarkationController::processSimObjectDeleted |
( |
DtSimObjectReference | simObject | ) |
|
|
protectedvirtual |
Handles simulation object deletion events.
- Parameters
-
| simObject | Reference to the simulation object being deleted |
If the deleted object is the entity this entity is currently embarked on, this method restores the posture, weapon status, and clears the embarkation slot. This ensures proper cleanup when carrier entities are removed from the simulation.
◆ operator=()
Assignment operator (not implemented)
- Returns
- Reference to this object
Assignment operator is private and not implemented to prevent assignment.
References DtVreEmbarkationController().
◆ myVreEmbarkPSR
Pointer to the VRE embarkation process state repository.
References the VRE-specific embarkation PSR which adds slotPoint to watch for entity leaving slot position and free slot. This extended PSR provides additional capabilities beyond the base embarkation PSR.
◆ myUnembarkedWeaponState
| DtWeaponState makVre::DtVreEmbarkationController::myUnembarkedWeaponState |
|
protected |
Cached weapon state from before embarkation.
Stores the entity's weapon state (DIS appearance) before embarkation so it can be restored after disembarkation (addresses issue VRE-1220).
◆ myHandItem
| DtString makVre::DtVreEmbarkationController::myHandItem |
|
protected |
Cached hand item from before embarkation.
Stores the type of weapon being held before embarkation so it can be restored after disembarkation. This ensures weapon continuity.
◆ myWeaponStateCached
| bool makVre::DtVreEmbarkationController::myWeaponStateCached |
|
protected |
Flag indicating whether weapon state is cached.
When true, indicates that weapon state has been cached and can be restored during disembarkation. Controls when the cached state is restored.
◆ myAmInSlotPosition
| bool makVre::DtVreEmbarkationController::myAmInSlotPosition |
|
protected |
Flag indicating whether entity is in its embarkation slot.
When true, indicates that the entity has reached its assigned slot position. Used to detect when the entity leaves the slot, which may require cleanup actions.
◆ mySimObjectDeletedConnection
| boost::signals2::scoped_connection makVre::DtVreEmbarkationController::mySimObjectDeletedConnection |
|
protected |
Connection for simulation object deleted events.
Manages the connection to simulation object deleted events, which is used to handle cleanup when carrier entities are removed from the simulation.
The documentation for this class was generated from the following file: