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

Detailed Description

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>

Inheritance diagram for makVre::DtAglUpdater:
[legend]

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 DtAglUpdateroperator= (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
 

Constructor & Destructor Documentation

◆ DtAglUpdater() [1/3]

makVre::DtAglUpdater::DtAglUpdater ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = nullptr,
DtReaderWriterRegistry * parentRegistry = nullptr )

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 AGL updater component with the specified parameters.

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

◆ DtAglUpdater() [2/3]

makVre::DtAglUpdater::DtAglUpdater ( )
delete

Default constructor (not implemented)

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

◆ DtAglUpdater() [3/3]

makVre::DtAglUpdater::DtAglUpdater ( const DtAglUpdater & orig)
delete

Copy constructor (not implemented)

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

References DtAglUpdater().

◆ ~DtAglUpdater()

virtual makVre::DtAglUpdater::~DtAglUpdater ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the AGL updater component.

Member Function Documentation

◆ operator=()

const DtAglUpdater & makVre::DtAglUpdater::operator= ( const DtAglUpdater & orig)
delete

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtAglUpdater().

◆ tick()

virtual void makVre::DtAglUpdater::tick ( )
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.

◆ type()

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

Gets the type identifier for this component.

Returns
String identifying the component type (DtAglUpdaterType)

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

◆ updateAglAltitude()

virtual void makVre::DtAglUpdater::updateAglAltitude ( )
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.

◆ handleAglSubscription()

virtual DtVreMessageResult makVre::DtAglUpdater::handleAglSubscription ( DtVreMessage * msg)
virtual

Handles AGL subscription messages.

Parameters
msgThe subscription message to process
Returns
The message processing result

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.

◆ handleAglUnsubscription()

virtual DtVreMessageResult makVre::DtAglUpdater::handleAglUnsubscription ( DtVreMessage * msg)
virtual

Handles AGL unsubscription messages.

Parameters
msgThe unsubscription message to process
Returns
The message processing result

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.

◆ creator()

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

◆ initializeMessageHandlers()

void makVre::DtAglUpdater::initializeMessageHandlers ( )

Member Data Documentation

◆ myRequireAgl

bool makVre::DtAglUpdater::myRequireAgl = false
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.


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