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

Detailed Description

This specialized cockpit implementation sets the entity's name into each updater, allowing them to look up data based on the associated entity. Additionally, it identifies all properties with the prefix "Out_" and sends PropertyUpdateMessages whenever these values change.

The player station cockpit also adds special handling for visibility and performance optimization through update throttling.

#include <playerStationOsgGlStudioCockpit.h>

Inheritance diagram for makVre::DtPlayerStationOsgGlStudioCockpit:
[legend]

Public Member Functions

 DtPlayerStationOsgGlStudioCockpit (makVrv::DtDe &de, makVrv::DtUniqueID id)
 
virtual ~DtPlayerStationOsgGlStudioCockpit () override
 
virtual std::string className () const override
 
virtual double update () override
 
virtual double DtOsgGlStudioCockpit_update ()
 
virtual void createCockpit (const std::string &filename, const std::string &rsoName, DtPerspective p, makVrv::DtUniqueID attachedEntityElementId) override
 

Protected Member Functions

virtual osg::Group * createOverlayObjects () override
 
virtual osg::Group * createChannelNode () override
 
virtual DtVreMessageResult handleSetCockpitVisibility (DtVreMessage *msg)
 

Protected Attributes

osg::ref_ptr< osg::Group > myChannelNodeProtector
 
int myAttributeTickIndex
 
float myFrameRate
 
bool myFirstUpdate
 

Constructor & Destructor Documentation

◆ DtPlayerStationOsgGlStudioCockpit()

makVre::DtPlayerStationOsgGlStudioCockpit::DtPlayerStationOsgGlStudioCockpit ( makVrv::DtDe & de,
makVrv::DtUniqueID id )

Constructor.

Parameters
deReference to the display element
idUnique identifier for this cockpit instance

Creates a new player station OSG GLStudio cockpit with the specified ID

References de().

◆ ~DtPlayerStationOsgGlStudioCockpit()

virtual makVre::DtPlayerStationOsgGlStudioCockpit::~DtPlayerStationOsgGlStudioCockpit ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ className()

virtual std::string makVre::DtPlayerStationOsgGlStudioCockpit::className ( ) const
overridevirtual

Gets the class name of the model instance owner.

Returns
String containing the class name

This method is used to control how model instances are created and to identify the type of cockpit during agent operations

◆ update()

virtual double makVre::DtPlayerStationOsgGlStudioCockpit::update ( )
overridevirtual

Updates the cockpit state.

Returns
Time in seconds until the next update is needed

On first update call, sets GLStudio component properties such as MAK_HostId. Subsequent updates manage component state and property updates.

◆ DtOsgGlStudioCockpit_update()

virtual double makVre::DtPlayerStationOsgGlStudioCockpit::DtOsgGlStudioCockpit_update ( )
virtual

Performs base class update with throttling support.

Returns
Time in seconds until the next update is needed

Throttles GLStudio component property updates if the framerate falls below a specific threshold to maintain performance

◆ createCockpit()

virtual void makVre::DtPlayerStationOsgGlStudioCockpit::createCockpit ( const std::string & filename,
const std::string & rsoName,
DtPerspective p,
makVrv::DtUniqueID attachedEntityElementId )
overridevirtual

Creates the cockpit from the specified file.

Parameters
filenamePath to the GLStudio cockpit file
rsoNameName of the RSO (Rendered Scene Object)
pPerspective type for the cockpit
attachedEntityElementIdElement ID of the entity to attach to

Initializes the cockpit instance from the specified GLStudio file and associates it with the given entity

◆ createOverlayObjects()

virtual osg::Group * makVre::DtPlayerStationOsgGlStudioCockpit::createOverlayObjects ( )
overrideprotectedvirtual

Creates the HUD object and supporting nodes.

Returns
Pointer to the created OSG group containing overlay objects

Overridden to fix renderCockpitOnly instrument panels with SensorFX integration. This method constructs the actual OpenSceneGraph nodes for displaying the cockpit.

◆ createChannelNode()

virtual osg::Group * makVre::DtPlayerStationOsgGlStudioCockpit::createChannelNode ( )
overrideprotectedvirtual

Creates a channel-specific node for HUD integration.

Returns
Pointer to the created channel node

Creates channel-specific nodes and determines whether the HUD should be added to the channels. Overridden to maintain a reference to myChannelNode to prevent deletion during slot_channelModified operations.

◆ handleSetCockpitVisibility()

virtual DtVreMessageResult makVre::DtPlayerStationOsgGlStudioCockpit::handleSetCockpitVisibility ( DtVreMessage * msg)
protectedvirtual

Handles cockpit visibility control messages.

Parameters
msgPointer to the message to handle
Returns
Message processing result

Processes SetCockpitVisibility messages to toggle cockpit visibility. Used to hide the cockpit when the aircraft model is shown and vice-versa.

Member Data Documentation

◆ myChannelNodeProtector

osg::ref_ptr<osg::Group> makVre::DtPlayerStationOsgGlStudioCockpit::myChannelNodeProtector
protected

Reference-counted pointer to protect the channel node.

Keeps myChannelNode from being deleted during slot_channelModified. See createChannelNode() for more details.

◆ myAttributeTickIndex

int makVre::DtPlayerStationOsgGlStudioCockpit::myAttributeTickIndex
protected

Index for tracking attribute update cycles during throttling.

◆ myFrameRate

float makVre::DtPlayerStationOsgGlStudioCockpit::myFrameRate
protected

Current framerate for throttling decisions.

◆ myFirstUpdate

bool makVre::DtPlayerStationOsgGlStudioCockpit::myFirstUpdate
protected

Flag indicating if this is the first update.

Used to perform special initialization during the first update cycle


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