Low-Level C++ SDK  v1.2.0
Loading...
Searching...
No Matches
WeArtForce.h
Go to the documentation of this file.
1
6#pragma once
7#include "WeArtCommon.h"
8
10struct WeArtForce {
11public:
12 WeArtForce() : active(false), _value(DefaultValue) {};
13
14 WeArtForce(bool active, float force) {
15 this->active = active;
16 value(force);
17 }
18
19 static constexpr float DefaultValue = 0.0f;
20 static constexpr float MinValue = 0.0f;
21 static constexpr float MaxValue = 1.0f;
22
23 bool active;
24
27 float value() const {
28 return _value;
29 }
30
33 void value(float force) {
34 _value = force <= MinValue ? MinValue : force >= MaxValue ? MaxValue : force;
35 }
36
37 bool operator== (const WeArtForce& other) {
38 return (active == other.active && _value == other.value());
39 };
40
41private:
42 float _value;
43};
Force value to be applied to an effect.
Definition: WeArtForce.h:10
float value() const
Force value getter.
Definition: WeArtForce.h:27
bool operator==(const WeArtForce &other)
Definition: WeArtForce.h:37
WeArtForce()
Definition: WeArtForce.h:12
static constexpr float MaxValue
Definition: WeArtForce.h:21
void value(float force)
Force value setter.
Definition: WeArtForce.h:33
WeArtForce(bool active, float force)
Definition: WeArtForce.h:14
static constexpr float DefaultValue
Definition: WeArtForce.h:19
bool active
Definition: WeArtForce.h:23
static constexpr float MinValue
Definition: WeArtForce.h:20