VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVreEmbeddedEntitiesController Class Reference

Detailed Description

DtVreEmbeddedEntitiesController handles all tasking and name resolution of embedded entities. It manages state transitions, name resolution, task/set forwarding to embedded entities, recovery, deployment, and other related operations. This VRE extension includes fixes for handling static embedded entities and preventing crashes during deployment.

#include <vreEmbeddedEntitiesController.h>

Inheritance diagram for makVre::DtVreEmbeddedEntitiesController:
[legend]

Public Member Functions

 DtVreEmbeddedEntitiesController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreEmbeddedEntitiesController () override
 
virtual const char * type () const override
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtEmbeddedEntitiesController >
 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 performRecovery () override
 
virtual bool performDeployment () override
 
virtual bool commandEeToReturn (const DtString &entityName) override
 
virtual void restoreEmbedded (DtRwEmbeddedEntityStatus *const eeStatus) override
 
virtual void tick () override
 
virtual DtVector calculateSpawnPosOfTarget () override
 

Constructor & Destructor Documentation

◆ DtVreEmbeddedEntitiesController()

makVre::DtVreEmbeddedEntitiesController::DtVreEmbeddedEntitiesController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Parameters
nameThe name of this component
ownerThe local object that owns this component
simManagerThe simulation services manager
descComponent descriptor with configuration parameters
parentRegistryOptional parent registry for reader/writer functionality

Creates a new embedded entities controller component with the specified parameters.

◆ ~DtVreEmbeddedEntitiesController()

virtual makVre::DtVreEmbeddedEntitiesController::~DtVreEmbeddedEntitiesController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the embedded entities controller component.

Member Function Documentation

◆ type()

virtual const char * makVre::DtVreEmbeddedEntitiesController::type ( ) const
overridevirtual

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreEmbeddedEntitiesControllerType)

Implements the DtSimComponent::type() method to return the type identifier for this component.

◆ creator()

static DtSimComponent * makVre::DtVreEmbeddedEntitiesController::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
nameThe name for the new component
ownerThe local object that will own this component
simManagerThe simulation services manager
descOptional component descriptor
parentRegistryOptional 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.

◆ performRecovery()

virtual bool makVre::DtVreEmbeddedEntitiesController::performRecovery ( )
overrideprotectedvirtual

Recovers embedded entities.

Returns
True if the recovery operation was successful, false otherwise

Overridden to properly handle static embedded entities, such as tripod-mounted launchers. This method implements the recovery process for embedded entities, bringing them back to their parent entity when required.

◆ performDeployment()

virtual bool makVre::DtVreEmbeddedEntitiesController::performDeployment ( )
overrideprotectedvirtual

Deploys embedded entities.

Returns
True if the deployment operation was successful, false otherwise

Overridden to fix a crash that occurs when the embedded entity cannot be created during deployment. This method safely handles deployment failures and prevents simulation crashes.

◆ commandEeToReturn()

virtual bool makVre::DtVreEmbeddedEntitiesController::commandEeToReturn ( const DtString & entityName)
overrideprotectedvirtual

Commands an embedded entity to return to its parent.

Parameters
entityNameThe name of the embedded entity to return
Returns
True if the command was successfully issued, false otherwise

Overridden to properly handle static embedded entities when commanding them to return to their parent entity. This ensures proper behavior for entities that don't normally move or navigate.

◆ restoreEmbedded()

virtual void makVre::DtVreEmbeddedEntitiesController::restoreEmbedded ( DtRwEmbeddedEntityStatus *const eeStatus)
overrideprotectedvirtual

Restores an embedded entity to its parent.

Parameters
eeStatusPointer to the embedded entity status to restore

Overridden to reset resources on deployed embedded entities during the restoration process. This ensures proper resource management when embedded entities are returned to their parent entity.

◆ tick()

virtual void makVre::DtVreEmbeddedEntitiesController::tick ( )
overrideprotectedvirtual

Updates the controller state each simulation frame.

Adds embedded entity status information into extended data during each simulation frame. This allows other components and systems to access current information about embedded entities.

◆ calculateSpawnPosOfTarget()

virtual DtVector makVre::DtVreEmbeddedEntitiesController::calculateSpawnPosOfTarget ( )
overrideprotectedvirtual

Calculates the spawn position for an embedded entity.

Returns
Vector containing the calculated spawn position coordinates

Overridden to adjust the spawn point if the host entity is embarked in another entity. Increases the release altitude by the embarkation parent entity's altitude, ensuring that embedded entities are spawned at the correct position relative to both the immediate parent and any carrier entity.


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