#include <vreLasingController.h>
|
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| |
| static void | setRestoreCallback (DtSimMessage *msg, void *usrData) |
| |
◆ DtVreLasingController() [1/3]
| makVre::DtVreLasingController::DtVreLasingController |
( |
| ) |
|
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
Referenced by DtVreLasingController(), and operator=().
◆ DtVreLasingController() [2/3]
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtVreLasingController().
◆ DtVreLasingController() [3/3]
| makVre::DtVreLasingController::DtVreLasingController |
( |
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 lasing controller component with the specified parameters.
◆ ~DtVreLasingController()
| virtual makVre::DtVreLasingController::~DtVreLasingController |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the lasing controller component.
◆ operator=()
Assignment operator (not implemented)
- Returns
- Reference to this object
Assignment operator is private and not implemented to prevent assignment.
References DtVreLasingController().
◆ type()
| virtual const char * makVre::DtVreLasingController::type |
( |
| ) |
const |
|
overridevirtual |
Gets the type identifier for this component.
- Returns
- String identifying the component type (DtVreLasingControllerType)
Implements the DtSimComponent::type() method to return the type identifier for this component.
◆ preFirstTickInit()
| virtual void makVre::DtVreLasingController::preFirstTickInit |
( |
| ) |
|
|
overridevirtual |
Performs initialization before the first simulation tick.
Gets initial laser designator code from the Process State Repository (PSR) and copies it to the state property "laserCode". This ensures that the GUI displays the correct laser code when the simulation starts.
◆ tick()
| virtual void makVre::DtVreLasingController::tick |
( |
| ) |
|
|
overridevirtual |
Updates the controller state each simulation frame.
Processes lasing operations during each simulation frame. This includes updating laser position, checking line of sight conditions, and managing the lasing state based on player inputs.
◆ init()
| virtual bool makVre::DtVreLasingController::init |
( |
| ) |
|
|
overridevirtual |
Initializes the lasing controller.
- Returns
- True if initialization is successful, false otherwise
Sets the state property named "HasLaser" to True. This property is defined in the platform sysdef file under state-data and is used by the VR-Engage menu system to determine whether to show laser designation options in the user interface.
◆ creator()
| static DtSimComponent * makVre::DtVreLasingController::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.
◆ setRestoreCallback()
| static void makVre::DtVreLasingController::setRestoreCallback |
( |
DtSimMessage * | msg, |
|
|
void * | usrData ) |
|
static |
Callback for entity restoration events.
- Parameters
-
| msg | The message containing restoration information |
| usrData | User data pointer, typically pointing to the instance of this class |
Static callback function invoked when an entity is restored. This function forwards the message to the instance's processSetRestore method to reinitialize state properties.
◆ handleStartLasingLocation()
Handles messages to start lasing at a specific location.
- Parameters
-
| msg | The message containing lasing parameters |
- Returns
- Message processing result indicating success or failure
Processes StartLasingLocation messages, which activate the laser designator at a specified location. This allows the entity to designate targets for laser-guided weapons.
◆ handleStopLasingLocation()
Handles messages to stop lasing.
- Parameters
-
| msg | The message containing stop lasing request |
- Returns
- Message processing result indicating success or failure
Processes StopLasingLocation messages, which deactivate the laser designator. This turns off the laser and stops target designation.
◆ handleSetLasingLocation()
Handles messages to set a new lasing location.
- Parameters
-
| msg | The message containing new lasing location parameters |
- Returns
- Message processing result indicating success or failure
Processes SetLasingLocation messages, which update the location at which the laser designator is pointing. This allows for tracking moving targets or switching designation to a new target.
◆ processSetRestore()
| virtual void makVre::DtVreLasingController::processSetRestore |
( |
DtSimMessage * | msg | ) |
|
|
protectedvirtual |
Processes entity restoration messages.
- Parameters
-
| msg | The message containing restoration information |
Reinitializes the state property "HasLaser" when a set restore operation is executed. This ensures that the entity's laser capabilities are properly restored after entity restoration, allowing the VR-Engage menu to correctly display laser options.
◆ processSetLaserCodeRequestMessage()
| virtual void makVre::DtVreLasingController::processSetLaserCodeRequestMessage |
( |
DtSimMessage * | msg | ) |
|
|
overrideprotectedvirtual |
Processes laser code change requests.
- Parameters
-
| msg | The message containing the new laser code |
Sets the state property for laser code based on the message contents, so the updated code can be reflected in the GUI. This allows users to change laser codes through the user interface, ensuring that laser-guided weapons are properly configured for the selected code.
◆ lineOfSight()
| virtual bool makVre::DtVreLasingController::lineOfSight |
( |
DtSimObjectReference | target, |
|
|
DtString & | reason ) |
|
overrideprotectedvirtual |
Determines if the controller has line of sight to a target.
- Parameters
-
| target | Reference to the target object |
| reason | Output parameter that will contain the reason for line of sight failure |
- Returns
- True if line of sight exists, false otherwise
Checks whether the laser controller has line of sight with the specified target. Overridden to demote an excessive warning in the console (changed from DtWarn to DtVerbose level). The actual line of sight calculation functionality remains unchanged from the base class implementation.
◆ myPlayerIsLasing
| bool makVre::DtVreLasingController::myPlayerIsLasing |
|
protected |
Flag indicating whether the player is currently lasing.
When true, indicates that the player has activated the laser designator and is currently designating a target. This state affects various controller behaviors including message handling and visual effects.
The documentation for this class was generated from the following file: