-
Notifications
You must be signed in to change notification settings - Fork 3
/
WeArtEffect.h
57 lines (47 loc) · 1.55 KB
/
WeArtEffect.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "WeArtTemperature.h"
#include "WeArtForce.h"
#include "WeArtTexture.h"
#include <vector>
//! @brief General effect function interface
class WeArtEffect {
public:
//! @brief Get temperature value
//! @return current effect temperature value
virtual WeArtTemperature getTemperature() = 0;
//! @brief Get force value
//! @return current effect forcevalue
virtual WeArtForce getForce() = 0;
//! @brief Get texture value
//! @return current effect texture value
virtual WeArtTexture getTexture() = 0;
};
//! @brief Basic object to apply effects
//!
//! The TouchEffect object allows to apply simple effect to an haptic object.
//! The temperature and force values are applied as set in the object, while
//! the texture velocity is forced to its maximum value if active.
class TouchEffect : public WeArtEffect {
public:
TouchEffect(WeArtTemperature temp, WeArtForce force, WeArtTexture texture)
: _temperature(temp), _force(force), _texture(texture) {}
//! @brief Set the effect parameters
//! @param temp Temperature to apply
//! @param force Force to apply
//! @param texture Texture to apply
//! @return true if one of the parameters changed, false otherwise
bool Set(WeArtTemperature temp, WeArtForce force, WeArtTexture texture);
virtual WeArtTemperature getTemperature() override {
return _temperature;
}
virtual WeArtForce getForce() override {
return _force;
}
virtual WeArtTexture getTexture() override {
return _texture;
}
private:
WeArtTemperature _temperature;
WeArtForce _force;
WeArtTexture _texture;
};