12 #ifndef hifi_VisionSqueeze_h
13 #define hifi_VisionSqueeze_h
16 #include <glm/glm.hpp>
18 #include <SettingHandle.h>
20 static const float DEFAULT_VISION_SQUEEZE_TURNING_X_FACTOR = 0.51f;
21 static const float DEFAULT_VISION_SQUEEZE_TURNING_Y_FACTOR = 0.36f;
22 static const float DEFAULT_VISION_SQUEEZE_UNSQUEEZE_DELAY = 0.2f;
23 static const float DEFAULT_VISION_SQUEEZE_UNSQUEEZE_SPEED = 3.0f;
24 static const float DEFAULT_VISION_SQUEEZE_TRANSITION = 0.25f;
25 static const int DEFAULT_VISION_SQUEEZE_PER_EYE = 1;
26 static const float DEFAULT_VISION_SQUEEZE_GROUND_PLANE_Y = 0.0f;
27 static const float DEFAULT_VISION_SQUEEZE_SPOTLIGHT_SIZE = 6.0f;
36 bool getVisionSqueezeEnabled()
const {
return _visionSqueezeEnabled; }
37 void setVisionSqueezeEnabled(
bool value);
38 float getVisionSqueezeRatioX()
const {
return _visionSqueezeRatioX; }
39 float getVisionSqueezeRatioY()
const {
return _visionSqueezeRatioY; }
40 void setVisionSqueezeRatioX(
float value);
41 void setVisionSqueezeRatioY(
float value);
42 float getVisionSqueezeUnSqueezeDelay()
const {
return _visionSqueezeUnSqueezeDelay; }
43 void setVisionSqueezeUnSqueezeDelay(
float value);
44 float getVisionSqueezeUnSqueezeSpeed()
const {
return _visionSqueezeUnSqueezeSpeed; }
45 void setVisionSqueezeUnSqueezeSpeed(
float value);
46 float getVisionSqueezeTransition()
const {
return _visionSqueezeTransition; }
47 void setVisionSqueezeTransition(
float value);
48 int getVisionSqueezePerEye()
const {
return _visionSqueezePerEye; }
49 void setVisionSqueezePerEye(
int value);
50 float getVisionSqueezeGroundPlaneY()
const {
return _visionSqueezeGroundPlaneY; }
51 void setVisionSqueezeGroundPlaneY(
float value);
52 float getVisionSqueezeSpotlightSize()
const {
return _visionSqueezeSpotlightSize; }
53 void setVisionSqueezeSpotlightSize(
float value);
54 float getVisionSqueezeTurningXFactor()
const {
return _visionSqueezeTurningXFactor; }
55 void setVisionSqueezeTurningXFactor(
float value);
56 float getVisionSqueezeTurningYFactor()
const {
return _visionSqueezeTurningYFactor; }
57 void setVisionSqueezeTurningYFactor(
float value);
59 void updateVisionSqueeze(
const glm::mat4& sensorToWorldMatrix,
float deltaTime);
62 bool getSqueezeVision()
const {
return _squeezeVision; }
63 void setSqueezeVision(
bool value) { _squeezeVision = value; }
64 bool getSqueezeVisionTurning()
const {
return _squeezeVisionTurning; }
65 void setSqueezeVisionTurning(
bool value) { _squeezeVisionTurning = value; }
72 DEFAULT_VISION_SQUEEZE_UNSQUEEZE_DELAY};
74 DEFAULT_VISION_SQUEEZE_UNSQUEEZE_SPEED};
75 Setting::Handle<float> _visionSqueezeTransitionSetting {
"visionSqueezeTransition", DEFAULT_VISION_SQUEEZE_TRANSITION};
76 Setting::Handle<float> _visionSqueezePerEyeSetting {
"visionSqueezePerEye", DEFAULT_VISION_SQUEEZE_PER_EYE};
78 DEFAULT_VISION_SQUEEZE_GROUND_PLANE_Y};
80 DEFAULT_VISION_SQUEEZE_SPOTLIGHT_SIZE};
82 DEFAULT_VISION_SQUEEZE_TURNING_X_FACTOR};
84 DEFAULT_VISION_SQUEEZE_TURNING_Y_FACTOR};
88 std::atomic<bool> _visionSqueezeEnabled {
false };
89 std::atomic<float> _visionSqueezeRatioX { 0.0f };
90 std::atomic<float> _visionSqueezeRatioY { 0.0f };
91 std::atomic<float> _visionSqueezeUnSqueezeDelay { DEFAULT_VISION_SQUEEZE_UNSQUEEZE_DELAY };
92 std::atomic<float> _visionSqueezeUnSqueezeSpeed { DEFAULT_VISION_SQUEEZE_UNSQUEEZE_SPEED };
93 std::atomic<float> _visionSqueezeTransition { DEFAULT_VISION_SQUEEZE_TRANSITION };
94 std::atomic<int> _visionSqueezePerEye { DEFAULT_VISION_SQUEEZE_PER_EYE };
95 std::atomic<float> _visionSqueezeGroundPlaneY { DEFAULT_VISION_SQUEEZE_GROUND_PLANE_Y };
96 std::atomic<float> _visionSqueezeSpotlightSize { DEFAULT_VISION_SQUEEZE_SPOTLIGHT_SIZE };
97 std::atomic<float> _visionSqueezeTurningXFactor { DEFAULT_VISION_SQUEEZE_TURNING_X_FACTOR };
98 std::atomic<float> _visionSqueezeTurningYFactor { DEFAULT_VISION_SQUEEZE_TURNING_Y_FACTOR };
100 bool _squeezeVision {
false };
101 bool _squeezeVisionTurning {
false };
103 float _visionSqueezeLockout { 0.0 };
104 glm::vec3 _prevTranslation;
105 glm::quat _prevRotation;