VR-Engage  2.2
Loading...
Searching...
No Matches
scaleValueTransform.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 scales input values by a speed factor
8
9#pragma once
10
11#include "vreInput/export.h"
13
14namespace makVre
15{
16//! \brief Value transformation that applies speed-based scaling to input values
17//!
18//! This transform scales input values by a speed factor. It's useful for adjusting
19//! the speed of movement or rotation in response to input, such as camera or
20//! character movement speeds.
22{
23public:
24 //! \brief Default constructor
25 //!
26 //! Initializes the speed value to 1.0 (no scaling)
28
29 //! \brief Virtual destructor
30 virtual ~DtScaleValueTransform() override;
31
32 //! \brief Initialize the scale transform from configuration
33 //!
34 //! Reads the speed value from the configuration table.
35 //! The expected configuration parameter is "Speed" which specifies
36 //! the scaling 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 scaling transformation to an input value
42 //!
43 //! Multiplies the input value by the speed factor.
44 //!
45 //! \param value The raw input value to transform
46 //! \return The transformed value (input * speed)
47 virtual float transform(float value) override;
48
49protected:
50 //! \brief Speed scaling factor
51 //!
52 //! Input values are multiplied by this factor to adjust movement or rotation speed
53 float mySpeed;
54};
55
56} // namespace makVre
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual float transform(float value) override
Apply the scaling transformation to an input value.
DtScaleValueTransform()
Default constructor.
virtual ~DtScaleValueTransform() override
Virtual destructor.
float mySpeed
Speed scaling factor.
Definition scaleValueTransform.h:53
virtual void init(DtInitTable *config) override
Initialize the scale transform from configuration.
DtValueTransform()
Default constructor.
Definition valueTransform.h:27
Defines DLL export/import macros for the vreInput library.
#define VREINPUT_DLL
DLL export/import macro for the vreInput library.
Definition export.h:25
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Abstract base class for input value transformation operations.