|
VR-Engage
2.2
|
The DtAglUpdater exists to set the altitude-agl extended data, which is used by the aircraft HUD and other systems. It performs terrain intersections in the simulation which are more precise than those performed in the GUI, as GUI intersections depend on the level of detail (LOD) of the terrain that is currently loaded.
#include <aglUpdater.h>
Public Member Functions | |
| DtAglUpdater (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr) | |
| DtAglUpdater ()=delete | |
| DtAglUpdater (const DtAglUpdater &orig)=delete | |
| const DtAglUpdater & | operator= (const DtAglUpdater &orig)=delete |
| virtual | ~DtAglUpdater () override |
| virtual void | tick () override |
| virtual const char * | type () const override |
| virtual void | updateAglAltitude () |
| virtual DtVreMessageResult | handleAglSubscription (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleAglUnsubscription (DtVreMessage *msg) |
| void | initializeMessageHandlers () |
Public Member Functions inherited from makVre::DtVreSimComponent< DtSimComponent > | |
| 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, DtReaderWriterRegistry *parentRegistry) |
Protected Attributes | |
| bool | myRequireAgl = false |
| makVre::DtAglUpdater::DtAglUpdater | ( | const DtString & | name, |
| DtLocalObject * | owner, | ||
| DtSimulationServices * | simManager, | ||
| DtComponentDescriptor * | desc = nullptr, | ||
| DtReaderWriterRegistry * | parentRegistry = nullptr ) |
Constructor.
| name | The name of this component |
| owner | The local object that owns this component |
| simManager | The simulation services manager |
| desc | Optional component descriptor |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new AGL updater component with the specified parameters.
Referenced by DtAglUpdater(), and operator=().
|
delete |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
|
delete |
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtAglUpdater().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the AGL updater component.
|
delete |
Assignment operator (not implemented)
Assignment operator is private and not implemented to prevent assignment.
References DtAglUpdater().
|
overridevirtual |
Update method called each simulation frame.
If the entity is player-controlled and myRequireAgl is true, this method will update the AGL altitude by calling updateAglAltitude(). This ensures the AGL data is refreshed only when needed, to optimize performance.
|
overridevirtual |
Gets the type identifier for this component.
Implements the DtSimComponent::type() method to return the type identifier for this component.
|
virtual |
Updates the AGL altitude value for the entity.
Calculates and sets the "altitude-agl" extended data value to be the difference between the entity's altitude and the terrain height at the entity's current location. This provides an accurate above-ground-level altitude value that can be used by HUDs and other systems.
|
virtual |
Handles AGL subscription messages.
| msg | The subscription message to process |
Processes messages that request subscription to AGL updates. When a system subscribes, the myRequireAgl flag is set to true, indicating that AGL updates should be performed each frame.
|
virtual |
Handles AGL unsubscription messages.
| msg | The unsubscription message to process |
Processes messages that request unsubscription from AGL updates. When the last system unsubscribes, the myRequireAgl flag may be set to false to stop performing AGL updates each frame.
|
static |
Factory method to create a new instance of this component.
| 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 |
Static factory method used by the component creation system to instantiate new instances of this component type.
| void makVre::DtAglUpdater::initializeMessageHandlers | ( | ) |
|
protected |
Flag indicating whether AGL updates are required.
When true, AGL altitude is updated every tick. This flag is set when systems subscribe to AGL updates and cleared when all subscribers have unsubscribed.