|
VR-Engage
2.2
|
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 | |
| DtInputEvaluator & | operator= (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 | |
| DtVreInputManager & | myManager |
| 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 |
| 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.
| mapper | Reference to the input manager |
| group | The input group name for organizing related evaluators |
| config | Pointer to the configuration data for this evaluator |
Referenced by DtInputEvaluator(), and operator=().
|
virtual |
Virtual destructor.
|
delete |
Copy constructor (deleted)
Input evaluators cannot be copied due to unique ownership of transforms
References DtInputEvaluator().
|
delete |
Assignment operator (deleted)
Input evaluators cannot be assigned due to unique ownership of transforms
References DtInputEvaluator().
|
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.
| data | The input data structure containing the event information |
|
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.
|
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.
| dt | Delta time in seconds since the last frame |
|
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.
|
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.
References myAction.
|
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.
| value | The final transformed value to pass to the action handler |
|
protected |
Reference to the input manager that owns this evaluator.
|
protected |
Group name this evaluator's action is part of.
|
protected |
Name of the action associated with this evaluator.
Referenced by getActionName().
|
protected |
List of value transformations to apply to input values.
|
protected |
Current input value after processing.
|
protected |
Flag indicating if input should be repeated when held.
|
protected |
Rate at which input should be repeated (in Hz)
|
protected |
Simulation time when the next repeated input should occur.
|
protected |
Flag indicating if input smoothing is enabled.
|
protected |
Buffer for smoothing input values.