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

Detailed Description

DtZoomControl manages view magnification through a set of configurable zoom levels. It provides input handlers for zooming in and out, updates state attributes to reflect current zoom levels, and adjusts aim input scaling proportionally to the zoom level to maintain consistent aiming sensitivity at different magnifications.

#include <zoomControl.h>

Inheritance diagram for makVre::DtZoomControl:
[legend]

Public Member Functions

 DtZoomControl ()
 
virtual ~DtZoomControl () override
 
virtual bool initialize (DtPlayerStation *player, DtInitTable &config) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
virtual void zoomIn (double val)
 
virtual void zoomOut (double val)
 
virtual void zoom (float val)
 
- Public Member Functions inherited from makVre::DtEntityControlLogic
 DtEntityControlLogic ()
 
virtual ~DtEntityControlLogic () override
 
virtual bool postInitialize () override
 
virtual void tick (double dt) 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
 
std::vector< double > myZoomLevels
 
int myZoomIndex
 
- 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

◆ DtZoomControl()

makVre::DtZoomControl::DtZoomControl ( )

Constructor for DtZoomControl.

Initializes the zoom control component and checks out the VR-Engage ground feature license

◆ ~DtZoomControl()

virtual makVre::DtZoomControl::~DtZoomControl ( )
overridevirtual

Virtual destructor for DtZoomControl.

Member Function Documentation

◆ initialize()

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

Initializes the zoom control component.

Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing zoom settings
Returns
True if initialization succeeded, false otherwise

Sets up zoom levels from configuration or uses default levels if not specified, initializes state attributes, and configures input handlers for zoom controls

Reimplemented from makVre::DtEntityControlLogic.

References makVre::DtPlayerComponent::player().

◆ shutdown()

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

Shuts down the zoom control component.

Cleans up input logic and performs base class shutdown operations

Reimplemented from makVre::DtEntityControlLogic.

◆ type()

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

Returns the type identifier for this component.

Returns
The type string for DtZoomControl

Reimplemented from makVre::DtEntityControlLogic.

◆ zoomIn()

virtual void makVre::DtZoomControl::zoomIn ( double val)
virtual

Input handler for zooming in.

Parameters
valInput value (non-zero to trigger zoom)

Increases the zoom index to the next higher magnification level and updates state attributes with the new zoom value and adjusted aim sensitivity

◆ zoomOut()

virtual void makVre::DtZoomControl::zoomOut ( double val)
virtual

Input handler for zooming out.

Parameters
valInput value (non-zero to trigger zoom)

Decreases the zoom index to the next lower magnification level and updates state attributes with the new zoom value and adjusted aim sensitivity

◆ zoom()

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

Input handler for incremental zooming.

Parameters
valInput value (positive to zoom in, negative to zoom out)

Calls either zoomIn or zoomOut based on the sign of the input value

Member Data Documentation

◆ myInputLogic

DtInputLogic makVre::DtZoomControl::myInputLogic
protected

Input logic that handles mapping of input actions to zoom functions.

◆ myZoomLevels

std::vector<double> makVre::DtZoomControl::myZoomLevels
protected

Collection of available zoom magnification levels.

◆ myZoomIndex

int makVre::DtZoomControl::myZoomIndex
protected

Current index into the zoom levels array.


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