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

Detailed Description

This transform applies a dead zone to input values. Values within the dead zone (close to zero) are filtered out and returned as zero. This helps eliminate noise or small unintentional movements from input devices like joysticks.

#include <deadZoneValueTransform.h>

Inheritance diagram for makVre::DtDeadZoneValueTransform:
[legend]

Public Member Functions

 DtDeadZoneValueTransform ()
 
virtual ~DtDeadZoneValueTransform () override
 
virtual void init (DtInitTable *config) override
 
virtual float transform (float value) override
 
- Public Member Functions inherited from makVre::DtValueTransform
 DtValueTransform ()
 
virtual ~DtValueTransform ()
 

Protected Attributes

float myDeadZone = 0.0
 
float myScale = 1.0
 

Constructor & Destructor Documentation

◆ DtDeadZoneValueTransform()

makVre::DtDeadZoneValueTransform::DtDeadZoneValueTransform ( )

Default constructor.

Initializes the dead zone value to zero

◆ ~DtDeadZoneValueTransform()

virtual makVre::DtDeadZoneValueTransform::~DtDeadZoneValueTransform ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ init()

virtual void makVre::DtDeadZoneValueTransform::init ( DtInitTable * config)
overridevirtual

Initialize the dead zone transform from configuration.

Reads the dead zone value from the configuration table. The expected configuration parameter is "DeadZone" which specifies the threshold below which input values will be zeroed out.

Parameters
configPointer to the configuration table

Implements makVre::DtValueTransform.

◆ transform()

virtual float makVre::DtDeadZoneValueTransform::transform ( float value)
overridevirtual

Apply the dead zone transformation to an input value.

Values with absolute magnitude less than the dead zone threshold are set to zero. Values outside the dead zone are passed through unchanged.

Parameters
valueThe raw input value to transform
Returns
The transformed value (0.0 if within dead zone, original value otherwise)

Implements makVre::DtValueTransform.

Member Data Documentation

◆ myDeadZone

float makVre::DtDeadZoneValueTransform::myDeadZone = 0.0
protected

Dead zone threshold value.

Input values with absolute magnitude less than this value will be zeroed out

◆ myScale

float makVre::DtDeadZoneValueTransform::myScale = 1.0
protected

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