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

Detailed Description

This class evaluates input data from devices and determines if it should trigger an action. It applies transformations to the input values and handles features like input repetition and smoothing.

#include <inputEvaluator.h>

Public Member Functions

 DtInputEvaluator (DtVreInputManager &mapper, const std::string &group, DtInitTable *config)
 
virtual ~DtInputEvaluator ()
 
 DtInputEvaluator (const DtInputEvaluator &mapping)=delete
 
DtInputEvaluatoroperator= (const DtInputEvaluator &)=delete
 
virtual bool evaluate (const DtInputData &data)
 
virtual void initialize ()
 
virtual void tick (double dt)
 
virtual bool canEvaluate () const
 
virtual const std::string & getActionName () const
 
virtual void executeAction (float value)
 

Protected Attributes

DtVreInputManagermyManager
 
std::string myGroup
 
std::string myAction
 
std::vector< std::unique_ptr< DtValueTransform > > myTransforms
 
float myInputValue
 
bool myRepeatInput
 
float myRepeatRate
 
double myNextRepeatTime
 
bool mySmoothing
 
float myInputBuffer
 

Constructor & Destructor Documentation

◆ DtInputEvaluator() [1/2]

makVre::DtInputEvaluator::DtInputEvaluator ( DtVreInputManager & mapper,
const std::string & group,
DtInitTable * config )

Constructor that initializes the evaluator.

Creates a new input evaluator with the given configuration.

Parameters
mapperReference to the input manager
groupThe input group name for organizing related evaluators
configPointer to the configuration data for this evaluator

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

◆ ~DtInputEvaluator()

virtual makVre::DtInputEvaluator::~DtInputEvaluator ( )
virtual

Virtual destructor.

◆ DtInputEvaluator() [2/2]

makVre::DtInputEvaluator::DtInputEvaluator ( const DtInputEvaluator & mapping)
delete

Copy constructor (deleted)

Input evaluators cannot be copied due to unique ownership of transforms

References DtInputEvaluator().

Member Function Documentation

◆ operator=()

DtInputEvaluator & makVre::DtInputEvaluator::operator= ( const DtInputEvaluator & )
delete

Assignment operator (deleted)

Input evaluators cannot be assigned due to unique ownership of transforms

References DtInputEvaluator().

◆ evaluate()

virtual bool makVre::DtInputEvaluator::evaluate ( const DtInputData & data)
virtual

Evaluates input data to determine if an action should be triggered.

Processes the input data by applying transformations and determining if it should trigger the associated action. If an action is triggered, it creates an Action event and dispatches it to the event manager.

Parameters
dataThe input data structure containing the event information
Returns
True if an action was triggered, false otherwise

◆ initialize()

virtual void makVre::DtInputEvaluator::initialize ( )
virtual

Initializes or reinitializes the evaluator.

Resets the state of the evaluator to its initial values. May be called multiple times to reset the evaluator's state during runtime.

◆ tick()

virtual void makVre::DtInputEvaluator::tick ( double dt)
virtual

Updates time-based functionality for input evaluation.

Handles time-based evaluations such as input repetition based on the configured repeat rate. Should be called once per frame.

Parameters
dtDelta time in seconds since the last frame

◆ canEvaluate()

virtual bool makVre::DtInputEvaluator::canEvaluate ( ) const
virtual

Checks if the action associated with this evaluator can be triggered.

Determines whether an action handler is registered for this evaluator's action. If no handler is registered, the action cannot be evaluated or triggered.

Returns
True if the action can be evaluated (has a registered handler), false otherwise

◆ getActionName()

virtual const std::string & makVre::DtInputEvaluator::getActionName ( ) const
inlinevirtual

Gets the action name associated with this evaluator.

Returns the name of the action that this evaluator triggers when its input conditions are met.

Returns
String containing the action name

References myAction.

◆ executeAction()

virtual void makVre::DtInputEvaluator::executeAction ( float value)
virtual

Executes the associated action with the given value.

Passes the transformed input value to the registered action handler, triggering the action in the system.

Parameters
valueThe final transformed value to pass to the action handler

Member Data Documentation

◆ myManager

DtVreInputManager& makVre::DtInputEvaluator::myManager
protected

Reference to the input manager that owns this evaluator.

◆ myGroup

std::string makVre::DtInputEvaluator::myGroup
protected

Group name this evaluator's action is part of.

◆ myAction

std::string makVre::DtInputEvaluator::myAction
protected

Name of the action associated with this evaluator.

Referenced by getActionName().

◆ myTransforms

std::vector<std::unique_ptr<DtValueTransform> > makVre::DtInputEvaluator::myTransforms
protected

List of value transformations to apply to input values.

◆ myInputValue

float makVre::DtInputEvaluator::myInputValue
protected

Current input value after processing.

◆ myRepeatInput

bool makVre::DtInputEvaluator::myRepeatInput
protected

Flag indicating if input should be repeated when held.

◆ myRepeatRate

float makVre::DtInputEvaluator::myRepeatRate
protected

Rate at which input should be repeated (in Hz)

◆ myNextRepeatTime

double makVre::DtInputEvaluator::myNextRepeatTime
protected

Simulation time when the next repeated input should occur.

◆ mySmoothing

bool makVre::DtInputEvaluator::mySmoothing
protected

Flag indicating if input smoothing is enabled.

◆ myInputBuffer

float makVre::DtInputEvaluator::myInputBuffer
protected

Buffer for smoothing input values.


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