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

Detailed Description

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>

Inheritance diagram for makVre::DtVreTurretFocusController:
[legend]

Public Member Functions

 DtVreTurretFocusController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=NULL, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreTurretFocusController () override
 
virtual const char * type () const override
 
virtual bool init () override
 
virtual void tick () override
 
virtual void processSetTurretFocus (DtSimMessage *msg)
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtMountingController >
 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 void setTurretFocusCallback (DtSimMessage *msg, void *usrData)
 
static DtSimComponent * creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
 

Protected Attributes

DtUUID myTargetSimObjectUUID
 

Private Member Functions

 DtVreTurretFocusController (const DtVreTurretFocusController &orig)
 
DtVreTurretFocusControlleroperator= (const DtVreTurretFocusController &orig)
 

Constructor & Destructor Documentation

◆ DtVreTurretFocusController() [1/2]

makVre::DtVreTurretFocusController::DtVreTurretFocusController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = NULL,
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 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]

makVre::DtVreTurretFocusController::DtVreTurretFocusController ( const DtVreTurretFocusController & orig)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

References DtVreTurretFocusController().

Member Function Documentation

◆ 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
msgThe simulation message containing focus target information
usrDataUser 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
msgThe 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
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.

◆ operator=()

DtVreTurretFocusController & makVre::DtVreTurretFocusController::operator= ( const DtVreTurretFocusController & orig)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtVreTurretFocusController().

Member Data Documentation

◆ 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: