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>
|
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| |
◆ DtVreEmbeddedEntitiesController()
| makVre::DtVreEmbeddedEntitiesController::DtVreEmbeddedEntitiesController |
( |
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 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.
◆ 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
-
| 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.
◆ 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
-
| entityName | The 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
-
| eeStatus | Pointer 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: