|
VR-Engage
2.2
|
DtVreOccupancyDirectorController extends the base occupancy director to provide VR-Engage specific functionality for managing embarkation slots and entity roles. It handles entity embarkation requests, manages slot assignments, and provides information about available ingress/egress points and actions.
This controller is particularly useful for managing complex vehicles with multiple occupancy positions, each with potentially different roles, such as driver, gunner, commander, or passengers. It supports both scripted and interactive embarkation/disembarkation.
Uses Descriptor Type: DtOccupancyDirectorControllerDescriptor
#include <vreOccupancyDirectorController.h>
Public Member Functions | |
| DtVreOccupancyDirectorController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtVreOccupancyDirectorController () override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtVreSimComponent< DtOccupancyDirectorController > | |
| DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtVreSimComponent () |
| bool | isPlayerControlled (const std::string &role="") const |
| DtString | entitySystemName () const |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
Protected Member Functions | |
| virtual bool | reserveSlot (const DtEmbarkationSlotInformation &entry, const DtUUID &uuid) override |
| virtual void | giveUpSlot (int iSlot, const DtUUID &name) override |
| virtual makVre::DtVreMessageResult | handleEntityEmbarkationInformationRequestMessage (makVre::DtVreMessage *msg) |
| virtual void | generateEmbarkedActionPoints (const DtEntityType &forType, std::vector< EntityEmbarkationInformationMessage::ActionPoint > &actionPoints) |
| virtual bool | generateUnembarkedActionPoints (const DtEntityType &forType, std::vector< EntityEmbarkationInformationMessage::ActionPoint > &actionPoints) |
| makVre::DtVreOccupancyDirectorController::DtVreOccupancyDirectorController | ( | const DtString & | name, |
| DtLocalObject * | owner, | ||
| DtSimulationServices * | simManager, | ||
| DtComponentDescriptor * | desc = 0, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
| 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 occupancy director controller component with the specified parameters. Initializes the embarkation slot management and message handling functionality.
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the occupancy director controller component.
|
overridevirtual |
Gets the type identifier for this component.
Implements the DtSimComponent::type() method to return the type identifier for this component.
|
static |
Factory method to create a new instance of this component.
| 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 |
Static factory method used by the component creation system to instantiate new instances of this component type.
|
overrideprotectedvirtual |
Reserves an embarkation slot for an entity.
| entry | Information about the embarkation slot to reserve |
| uuid | UUID of the entity reserving the slot |
Extends the base class reserveSlot to assign the slot-defined role name to the entity (typically a human player) when embarking. This allows proper role assignment for entity appearance and functionality within the vehicle.
|
overrideprotectedvirtual |
Releases a previously reserved embarkation slot.
| iSlot | Index of the slot to release |
| name | UUID of the entity giving up the slot |
Releases a previously reserved embarkation slot, making it available for other entities to occupy. Also handles any role changes needed when the entity disembarks from the vehicle.
|
protectedvirtual |
Handles entity embarkation information request messages.
| msg | The message containing the embarkation information request |
Processes messages requesting information about embarkation possibilities for a specific entity. Generates and returns information about available slots, ingress points, and associated actions.
|
protectedvirtual |
Generates a list of actionable points for an embarked entity.
| forType | The entity type to generate action points for |
| actionPoints | Output vector to be filled with generated action points |
Generates a list of actionable points for an entity that is already embarked in the vehicle. Points can be either unoccupied slots (for changing positions) or egress points that map to a slot with a defined egressTechnique.
The egressTechnique string should be a script task name that opens the appropriate door for disembarkation. The egress point used is the first point in the route.
|
protectedvirtual |
Generates a list of actionable points for an entity wishing to embark.
| forType | The entity type to generate action points for |
| actionPoints | Output vector to be filled with generated action points |
Generates a list of actionable points for entities of the given type that wish to embark on the vehicle. Points are ingress points that either map to a single slot, or map to more than one slot where at least one slot defines an ingressTechnique.
The ingressTechnique string should be a script task name that opens the appropriate door for embarkation. The egress point used is the last point in the route.
Returns true if points were found, although the list may be empty if all are occupied. Returns false if no points exist for the given entity type.