DtVreTurretFocusController extends the mounting controller to provide functionality for focusing a turret on specific targets. It processes the turret_focus scripted task set and manages target tracking, allowing turrets to maintain focus on designated targets during movement and engagement. The controller receives target updates and ensures the turret remains pointed at the specified entity.
#include <vreTurretFocusController.h>
|
| static void | setTurretFocusCallback (DtSimMessage *msg, void *usrData) |
| |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry) |
| |
◆ DtVreTurretFocusController() [1/2]
| makVre::DtVreTurretFocusController::DtVreTurretFocusController |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc = NULL, |
|
|
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 turret focus controller component with the specified parameters.
Referenced by DtVreTurretFocusController(), and operator=().
◆ ~DtVreTurretFocusController()
| virtual makVre::DtVreTurretFocusController::~DtVreTurretFocusController |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the turret focus controller component.
◆ DtVreTurretFocusController() [2/2]
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtVreTurretFocusController().
◆ type()
| virtual const char * makVre::DtVreTurretFocusController::type |
( |
| ) |
const |
|
overridevirtual |
Gets the type identifier for this component.
- Returns
- String identifying the component type (DtVreTurretFocusControllerType)
Implements the DtSimComponent::type() method to return the type identifier for this component.
◆ init()
| virtual bool makVre::DtVreTurretFocusController::init |
( |
| ) |
|
|
overridevirtual |
Initializes the turret focus controller.
- Returns
- True if initialization is successful, false otherwise
Registers attribute provider functions and sets up message callbacks for turret focus control. Called during component creation.
◆ tick()
| virtual void makVre::DtVreTurretFocusController::tick |
( |
| ) |
|
|
overridevirtual |
Updates the turret focus each simulation frame.
Overridden to manage the turret's focus target point. Updates the mounting controller with the current position of the targeted entity, ensuring the turret remains pointed at the correct target during simulation.
◆ setTurretFocusCallback()
| static void makVre::DtVreTurretFocusController::setTurretFocusCallback |
( |
DtSimMessage * | msg, |
|
|
void * | usrData ) |
|
static |
Static callback function for turret focus messages.
- Parameters
-
| msg | The simulation message containing focus target information |
| usrData | User data pointer, typically pointing to an instance of this class |
Static function registered as a callback to handle turret focus messages. Forwards the message to the appropriate instance's processSetTurretFocus method.
◆ processSetTurretFocus()
| virtual void makVre::DtVreTurretFocusController::processSetTurretFocus |
( |
DtSimMessage * | msg | ) |
|
|
virtual |
Processes a turret focus message.
- Parameters
-
| msg | The simulation message containing focus target information |
Extracts the target entity UUID from the message and updates the controller's target focus accordingly. This sets the turret to focus on a specific entity.
◆ creator()
| static DtSimComponent * makVre::DtVreTurretFocusController::creator |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc, |
|
|
DtReaderWriterRegistry * | parentRegistry ) |
|
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.
◆ operator=()
Assignment operator (not implemented)
- Returns
- Reference to this object
Assignment operator is private and not implemented to prevent assignment.
References DtVreTurretFocusController().
◆ myTargetSimObjectUUID
| DtUUID makVre::DtVreTurretFocusController::myTargetSimObjectUUID |
|
protected |
UUID of the current target entity.
Stores the unique identifier of the entity that the turret is currently focused on tracking.
The documentation for this class was generated from the following file: