VR-Engage
2.2
Loading...
Searching...
No Matches
deadZoneValueTransform.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2025 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
6
//! \file
7
//! \brief Value transformation that applies a dead zone to input values
8
9
#pragma once
10
11
#include "
vreInput/export.h
"
12
#include "
vreInput/valueTransform.h
"
13
14
namespace
makVre
15
{
16
//! \brief Value transformation that filters out small input values
17
//!
18
//! This transform applies a dead zone to input values. Values within the dead zone
19
//! (close to zero) are filtered out and returned as zero. This helps eliminate
20
//! noise or small unintentional movements from input devices like joysticks.
21
class
VREINPUT_DLL
DtDeadZoneValueTransform
:
public
DtValueTransform
22
{
23
public
:
24
//! \brief Default constructor
25
//!
26
//! Initializes the dead zone value to zero
27
DtDeadZoneValueTransform
();
28
29
//! \brief Virtual destructor
30
virtual
~DtDeadZoneValueTransform
()
override
;
31
32
//! \brief Initialize the dead zone transform from configuration
33
//!
34
//! Reads the dead zone value from the configuration table.
35
//! The expected configuration parameter is "DeadZone" which specifies
36
//! the threshold below which input values will be zeroed out.
37
//!
38
//! \param config Pointer to the configuration table
39
virtual
void
init
(
DtInitTable
* config)
override
;
40
41
//! \brief Apply the dead zone transformation to an input value
42
//!
43
//! Values with absolute magnitude less than the dead zone threshold
44
//! are set to zero. Values outside the dead zone are passed through unchanged.
45
//!
46
//! \param value The raw input value to transform
47
//! \return The transformed value (0.0 if within dead zone, original value otherwise)
48
virtual
float
transform
(
float
value)
override
;
49
50
protected
:
51
//! \brief Dead zone threshold value
52
//!
53
//! Input values with absolute magnitude less than this value will be zeroed out
54
float
myDeadZone
= 0.0;
55
float
myScale
= 1.0;
56
};
57
58
}
// namespace makVre
makVre::DtDeadZoneValueTransform::myScale
float myScale
Definition
deadZoneValueTransform.h:55
makVre::DtDeadZoneValueTransform::init
virtual void init(DtInitTable *config) override
Initialize the dead zone transform from configuration.
makVre::DtDeadZoneValueTransform::DtDeadZoneValueTransform
DtDeadZoneValueTransform()
Default constructor.
makVre::DtDeadZoneValueTransform::~DtDeadZoneValueTransform
virtual ~DtDeadZoneValueTransform() override
Virtual destructor.
makVre::DtDeadZoneValueTransform::myDeadZone
float myDeadZone
Dead zone threshold value.
Definition
deadZoneValueTransform.h:54
makVre::DtDeadZoneValueTransform::transform
virtual float transform(float value) override
Apply the dead zone transformation to an input value.
makVre::DtInitTable
Table-based access to Lua state for configuration data.
Definition
initializer.h:38
makVre::DtValueTransform::DtValueTransform
DtValueTransform()
Default constructor.
Definition
valueTransform.h:27
export.h
Defines DLL export/import macros for the vreInput library.
VREINPUT_DLL
#define VREINPUT_DLL
DLL export/import macro for the vreInput library.
Definition
export.h:25
makVre
Include export definitions for this library.
Definition
glsVreMessageUtil.h:49
valueTransform.h
Abstract base class for input value transformation operations.
Generated on 2026-01-13 from SVN revision 282860 - Copyright © 2005-2026 MAK Technologies. All Rights Reserved.