VR-Engage  2.3
Loading...
Searching...
No Matches
makVre::DtSpectatorSimLogic Class Reference

Detailed Description

This component implements the simulation logic for the spectator role, managing view control, camera movement, and spectator-specific behavior. It processes view manipulation inputs, handles zoom operations, and provides spectator view control capabilities. As an entity control logic component, it also manages entity interactions in the simulation.

#include <spectatorSimLogic.h>

Inheritance diagram for makVre::DtSpectatorSimLogic:
[legend]

Public Member Functions

 DtSpectatorSimLogic ()
 
virtual ~DtSpectatorSimLogic () override
 
virtual bool initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
Input Functions
virtual void resetView (float val=1)
 
virtual void azimuth (float val)
 
virtual void elevation (float val)
 
virtual void zoomOut (float val)
 
virtual void zoomIn (float val)
 
virtual void zoom (float val)
 
- Public Member Functions inherited from makVre::DtEntityControlLogic
 DtEntityControlLogic ()
 
virtual ~DtEntityControlLogic () override
 
virtual bool postInitialize () override
 
virtual void setMouseControlEnabled (bool enabled)
 
virtual bool isMouseControlEnabled ()
 
virtual bool isMouseControlSupportAllowed () const
 
virtual void setMouseControlSupportAllowed (bool enable)
 
virtual const std::vector< std::string > & joystickGroups () const
 
virtual void sendJoystickCommand (const DtEntityIdentifier &id, const std::string &functionGroup, const std::string &function, double val, bool repeat=false)
 
virtual makVre::DtVreMessageResult handleSimState (makVre::DtVreMessage *msg)
 
virtual makVre::DtVreMessageResult handleReset (makVre::DtVreMessage *message)
 
virtual makVre::DtVreMessageResult handleCreationStatus (makVre::DtVreMessage *message)
 
virtual void reset (float val)
 
virtual void resetInPlace (float val)
 
virtual void toggleMouseControl (float val)
 
virtual void enableMouseControl (float val)
 
virtual makVre::DtVreMessageResult handleFocusMessage (makVre::DtVreMessage *message)
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
bool componentReady () const
 
void setComponentReady (bool ready)
 
virtual DtInitTickStatus finalizeInitTick (double dt)
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStation & player ()
 
virtual DtAttributeHandle & playerAttributeStore ()
 
virtual const DtAttributeHandle & playerAttributeStore () const
 
virtual const DtAttributeHandle & ownshipState () const
 
virtual void setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId())
 

Protected Attributes

DtInputLogic myInputLogic
 
DtAttributeHandleType< double > myAzimuthAttr
 
DtAttributeHandleType< double > myElevationAttr
 
DtAttributeHandleType< double > myDistanceAttr
 
- Protected Attributes inherited from makVre::DtEntityControlLogic
std::vector< std::string > myJoystickFunctionGroups
 
DtInputLogic myCommonInputLogic
 
std::string myInputConfigFile
 
bool myMouseControlEnabled
 
bool myMouseControlSupportAllowed
 
DtAttributeHandle myOwnshipAttr
 
DtAttributeHandleType< bool > myEmbarkedAttr
 
DtAttributeHandleType< DtEntityIdentifier > myEmbarkedHostAttr
 
DtAttributeHandleType< DtEntityType > myEmbarkedHostTypeAttr
 
DtAttributeHandleType< std::string > myEmbarkedHostMarkingAttr
 
DtAttributeHandleType< bool > myEmbarkedOnAircraftAttr
 
DtAttributeHandleType< std::string > myEmbarkedInSlotAttr
 
DtAttributeHandleType< unsigned int > myAppearanceAttr
 
DtAttributeHandleType< DtVector > myPositionAttr
 
DtAttributeHandleType< DtTaitBryan > myOrientationAttr
 
DtAttributeHandleType< double > mySpeedAttr
 
DtAttributeHandleType< DtVector32 > myVelocityAttr
 
DtAttributeHandleType< DtVector32 > myAccelerationAttr
 
DtAttributeHandleType< DtVector32 > myRotVelAttr
 
DtAttributeHandleType< DtEntityType > myEntityTypeAttr
 
DtAttributeHandleType< DtVector32 > myRelativeVelocityAttr
 
DtAttributeHandleType< DtDamageState > myDamageStateAttr
 
DtAttributeHandleType< int > mySimStateUpdateIndexAttr
 
DtAttributeHandleType< bool > myHideOccupantsAttr
 
- Protected Attributes inherited from makVre::DtPlayerComponent
bool myComponentReady = true
 
std::string myName
 
DtInitTable myConfig
 
DtPlayerStation * myPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolver * myResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 
DtVreMessageHandlerGroup myMessageHandlers
 

Additional Inherited Members

- Protected Member Functions inherited from makVre::DtEntityControlLogic
bool requiresControl () const
 
bool isAirborne () const
 
void showNotification (const QString &text, double duration)
 
virtual void takeControlOfPlayerEntity ()
 
virtual void releaseControlOfPlayerEntity ()
 
- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Constructor & Destructor Documentation

◆ DtSpectatorSimLogic()

makVre::DtSpectatorSimLogic::DtSpectatorSimLogic ( )

Default constructor.

◆ ~DtSpectatorSimLogic()

virtual makVre::DtSpectatorSimLogic::~DtSpectatorSimLogic ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtSpectatorSimLogic::initialize ( makVre::DtPlayerStation * player,
makVre::DtInitTable & config )
overridevirtual

Initializes the simulation logic component.

Parameters
playerPointer to the player station
configReference to the initialization configuration
Returns
True if initialization was successful, false otherwise

Sets up the spectator simulation logic and initializes input logic

Reimplemented from makVre::DtEntityControlLogic.

References makVre::DtPlayerComponent::player().

◆ tick()

virtual void makVre::DtSpectatorSimLogic::tick ( double dt)
overridevirtual

Updates simulation state each frame.

Parameters
dtDelta time since the last update in seconds

Updates the spectator simulation state based on inputs and current conditions

Reimplemented from makVre::DtEntityControlLogic.

◆ shutdown()

virtual void makVre::DtSpectatorSimLogic::shutdown ( )
overridevirtual

Performs cleanup when the component is shut down.

Releases resources and performs necessary cleanup operations

Reimplemented from makVre::DtEntityControlLogic.

◆ type()

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

Returns the component type identifier.

Returns
The component type string

Reimplemented from makVre::DtEntityControlLogic.

◆ resetView()

virtual void makVre::DtSpectatorSimLogic::resetView ( float val = 1)
virtual

Resets the view to default position.

Parameters
valReset magnitude (typically 1.0 for full reset)

Returns the view to its default orientation and position

◆ azimuth()

virtual void makVre::DtSpectatorSimLogic::azimuth ( float val)
virtual

Adjusts the view azimuth (horizontal rotation)

Parameters
valAzimuth adjustment value

Rotates the view horizontally by the specified amount

◆ elevation()

virtual void makVre::DtSpectatorSimLogic::elevation ( float val)
virtual

Adjusts the view elevation (vertical angle)

Parameters
valElevation adjustment value

Rotates the view vertically by the specified amount

◆ zoomOut()

virtual void makVre::DtSpectatorSimLogic::zoomOut ( float val)
virtual

Zooms the view out.

Parameters
valZoom magnitude value

Increases the view distance by the specified amount

◆ zoomIn()

virtual void makVre::DtSpectatorSimLogic::zoomIn ( float val)
virtual

Zooms the view in.

Parameters
valZoom magnitude value

Decreases the view distance by the specified amount

◆ zoom()

virtual void makVre::DtSpectatorSimLogic::zoom ( float val)
virtual

Adjusts the view zoom level directly.

Parameters
valZoom level value

Sets the view zoom level to the specified value

Member Data Documentation

◆ myInputLogic

DtInputLogic makVre::DtSpectatorSimLogic::myInputLogic
protected

Input logic component for handling user inputs.

Processes user inputs and translates them into simulation actions

◆ myAzimuthAttr

DtAttributeHandleType<double> makVre::DtSpectatorSimLogic::myAzimuthAttr
protected

Attribute handle storing the observer's azimuth angle in radians.

Attribute Store Keyazimuth

◆ myElevationAttr

DtAttributeHandleType<double> makVre::DtSpectatorSimLogic::myElevationAttr
protected

Attribute handle storing the observer's elevation angle in radians.

Attribute Store Keyelevation

◆ myDistanceAttr

DtAttributeHandleType<double> makVre::DtSpectatorSimLogic::myDistanceAttr
protected

Attribute handle storing the observer's distance from the attached entity.

Attribute Store Keydistance

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