VR-Engage
2.2
Loading...
Searching...
No Matches
gainValueTransform.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 gain (amplification) 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 multiplies input values by a gain factor
17
//!
18
//! This transform applies a gain (amplification factor) to input values.
19
//! It's useful for increasing or decreasing the sensitivity of input devices
20
//! like joysticks, mice, or other analog inputs.
21
class
VREINPUT_DLL
DtGainValueTransform
:
public
DtValueTransform
22
{
23
public
:
24
//! \brief Default constructor
25
//!
26
//! Initializes the gain value to 1.0 (no change)
27
DtGainValueTransform
();
28
29
//! \brief Virtual destructor
30
virtual
~DtGainValueTransform
()
override
;
31
32
//! \brief Initialize the gain transform from configuration
33
//!
34
//! Reads the gain value from the configuration table.
35
//! The expected configuration parameter is "Gain" which specifies
36
//! the multiplication factor to apply to input values.
37
//!
38
//! \param config Pointer to the configuration table
39
virtual
void
init
(
DtInitTable
* config)
override
;
40
41
//! \brief Apply the gain transformation to an input value
42
//!
43
//! Multiplies the input value by the gain factor.
44
//!
45
//! \param value The raw input value to transform
46
//! \return The transformed value (input * gain)
47
virtual
float
transform
(
float
value)
override
;
48
49
protected
:
50
//! \brief Gain multiplication factor
51
//!
52
//! Input values are multiplied by this factor to increase or decrease sensitivity
53
float
myGain
;
54
};
55
56
}
// namespace makVre
makVre::DtGainValueTransform::~DtGainValueTransform
virtual ~DtGainValueTransform() override
Virtual destructor.
makVre::DtGainValueTransform::init
virtual void init(DtInitTable *config) override
Initialize the gain transform from configuration.
makVre::DtGainValueTransform::DtGainValueTransform
DtGainValueTransform()
Default constructor.
makVre::DtGainValueTransform::transform
virtual float transform(float value) override
Apply the gain transformation to an input value.
makVre::DtGainValueTransform::myGain
float myGain
Gain multiplication factor.
Definition
gainValueTransform.h:53
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.