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

Detailed Description

The DtBullseyeController provides functionality for selecting, tracking, and reporting bullseye reference points in tactical simulations. It handles user selection of bullseye targets and communicates position updates to other simulation components.

#include <bullseyeController.h>

Inheritance diagram for makVre::DtBullseyeController:
[legend]

Public Member Functions

 DtBullseyeController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtBullseyeController () override
 
virtual const char * type () const override
 
virtual bool init () override
 
virtual DtBullseyePSRcreatePSR ()
 
void processSetLocationComplete (const DtLocalObject *obj)
 
void processSimObjectAdded (const DtLocalObject *obj)
 
void processSimObjectToBeRemoved (const DtLocalObject *obj)
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtControllerComponent >
 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 DtVreMessageResult handleSetBullseyeId (DtVreMessage *msg)
 
virtual DtVreMessageResult handleBullseyeStatusRequest (DtVreMessage *msg)
 
virtual void sendBullseyeStatusUpdate ()
 
virtual void setNewBullseye (DtSimObjectReference obj)
 
virtual void preFirstTickInit () override
 
virtual void tick () override
 
const char * defaultPSRType () const
 

Protected Attributes

bool myBullseyeIsValid
 
DtVector myLastBullseyeWorldPosition
 
DtBullseyePSRmyProcessState
 

Private Member Functions

 DtBullseyeController ()
 
 DtBullseyeController (const DtBullseyeController &orig)
 
const DtBullseyeControlleroperator= (const DtBullseyeController &orig)
 

Constructor & Destructor Documentation

◆ DtBullseyeController() [1/3]

makVre::DtBullseyeController::DtBullseyeController ( )
private

Default constructor (not implemented)

Default constructor is private and not implemented to prevent creation of instances without proper initialization.

Referenced by DtBullseyeController(), and operator=().

◆ DtBullseyeController() [2/3]

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

Copy constructor (not implemented)

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

References DtBullseyeController().

◆ DtBullseyeController() [3/3]

makVre::DtBullseyeController::DtBullseyeController ( 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
descOptional component descriptor
parentRegistryOptional parent registry for reader/writer functionality

Creates a new bullseye controller component with the specified parameters.

◆ ~DtBullseyeController()

virtual makVre::DtBullseyeController::~DtBullseyeController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the bullseye controller component.

Member Function Documentation

◆ operator=()

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

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtBullseyeController().

◆ type()

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

Gets the type identifier for this component.

Returns
String identifying the component type (DtBullseyeControllerType)

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

◆ init()

virtual bool makVre::DtBullseyeController::init ( )
overridevirtual

Initializes the component.

Returns
True if initialization is successful, false otherwise

Registers message handlers for bullseye-related messages, particularly vrfSetBullseyeIdMessage which is sent by pilotSimLogic.

◆ creator()

static DtSimComponent * makVre::DtBullseyeController::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.

◆ createPSR()

virtual DtBullseyePSR * makVre::DtBullseyeController::createPSR ( )
virtual

Creates the process state repository for this component.

Returns
Pointer to the newly created bullseye process state repository

Creates the myProcessState data member and adds it to the process state repository manager. Passes the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type are not specified, uses the appropriate default strings defined in procSRTypes.h.

◆ processSetLocationComplete()

void makVre::DtBullseyeController::processSetLocationComplete ( const DtLocalObject * obj)

Updates bullseye status when the target entity's location changes.

Parameters
objPointer to the local object that has changed location

Called when the bullseye target entity's location is updated. Updates the stored bullseye world position and sends status updates.

◆ processSimObjectAdded()

void makVre::DtBullseyeController::processSimObjectAdded ( const DtLocalObject * obj)

Handles simulation object addition events.

Parameters
objPointer to the newly added local object

Handles the case where a VRF scenario reloads. VR Engage will reset the bullseye target according to the saved bullseyeID when the target object is added to the simulation.

◆ processSimObjectToBeRemoved()

void makVre::DtBullseyeController::processSimObjectToBeRemoved ( const DtLocalObject * obj)

Handles simulation object removal events.

Parameters
objPointer to the local object being removed

Removes all callbacks related to the bullseye object when it's about to be removed from the simulation.

◆ handleSetBullseyeId()

virtual DtVreMessageResult makVre::DtBullseyeController::handleSetBullseyeId ( DtVreMessage * msg)
protectedvirtual

Handles bullseye target selection messages.

Parameters
msgPointer to the SetBullseyeIdMessage
Returns
Message processing result

Processes SetBullseyeIdMessage sent from the user interface and updates the current bullseye object based on the selected entity ID.

◆ handleBullseyeStatusRequest()

virtual DtVreMessageResult makVre::DtBullseyeController::handleBullseyeStatusRequest ( DtVreMessage * msg)
protectedvirtual

Handles bullseye status request messages.

Parameters
msgPointer to the BullseyeStatusRequestMessage
Returns
Message processing result

Processes BullseyeStatusRequestMessage sent from GUI components and responds with a BullseyeStatusUpdateMessage containing current bullseye information.

◆ sendBullseyeStatusUpdate()

virtual void makVre::DtBullseyeController::sendBullseyeStatusUpdate ( )
protectedvirtual

Sends bullseye status update to interested components.

Sends a BullseyeStatusUpdateMessage to the controlling entity with the selected bullseye's geocentric world location. Used to update HUD displays and other tactical information systems.

◆ setNewBullseye()

virtual void makVre::DtBullseyeController::setNewBullseye ( DtSimObjectReference obj)
protectedvirtual

Sets a new bullseye target.

Parameters
objReference to the simulation object to use as the bullseye target

Updates the current bullseye object, stores its location, and sends a bullseye status update to all interested components.

◆ preFirstTickInit()

virtual void makVre::DtBullseyeController::preFirstTickInit ( )
overrideprotectedvirtual

Performs initialization before the first tick.

Sets up initial state and connections needed before the first simulation tick is processed.

◆ tick()

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

Updates the controller state each simulation frame.

Performs periodic updates and processing during each simulation cycle.

◆ defaultPSRType()

const char * makVre::DtBullseyeController::defaultPSRType ( ) const
protected

Gets the default process state repository type.

Returns
String identifying the default PSR type (DtBullseyePSRType)

Returns the default process state repository type for this component.

Member Data Documentation

◆ myBullseyeIsValid

bool makVre::DtBullseyeController::myBullseyeIsValid
protected

Flag indicating if the bullseye reference is currently valid.

◆ myLastBullseyeWorldPosition

DtVector makVre::DtBullseyeController::myLastBullseyeWorldPosition
protected

Last known geocentric position of the bullseye target.

◆ myProcessState

DtBullseyePSR* makVre::DtBullseyeController::myProcessState
protected

Pointer to the bullseye process state repository.


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