mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:47:41 +02:00
Camera always stops moving when using gyro's
This commit is contained in:
parent
8ab36c87d7
commit
0d26bb4266
2 changed files with 7 additions and 2 deletions
|
@ -51,6 +51,7 @@ public:
|
||||||
void lowPassFilter(int16_t* inputBuffer);
|
void lowPassFilter(int16_t* inputBuffer);
|
||||||
|
|
||||||
void startCollisionSound(float magnitude, float frequency, float noise, float duration);
|
void startCollisionSound(float magnitude, float frequency, float noise, float duration);
|
||||||
|
|
||||||
float getCollisionSoundMagnitude() { return _collisionSoundMagnitude; };
|
float getCollisionSoundMagnitude() { return _collisionSoundMagnitude; };
|
||||||
|
|
||||||
int getSongFileBytes() { return _songFileBytes; }
|
int getSongFileBytes() { return _songFileBytes; }
|
||||||
|
|
|
@ -238,8 +238,12 @@ void Head::simulate(float deltaTime, bool isMine, float gyroCameraSensitivity) {
|
||||||
const float CAMERA_STOP_TOLERANCE_DEGREES = 0.5f;
|
const float CAMERA_STOP_TOLERANCE_DEGREES = 0.5f;
|
||||||
const float PITCH_START_RANGE = 20.f;
|
const float PITCH_START_RANGE = 20.f;
|
||||||
const float YAW_START_RANGE = 10.f;
|
const float YAW_START_RANGE = 10.f;
|
||||||
float pitchStartTolerance = PITCH_START_RANGE * (1.f - gyroCameraSensitivity);
|
float pitchStartTolerance = PITCH_START_RANGE
|
||||||
float yawStartTolerance = YAW_START_RANGE * (1.f - gyroCameraSensitivity);
|
* (1.f - gyroCameraSensitivity)
|
||||||
|
+ (2.f * CAMERA_STOP_TOLERANCE_DEGREES);
|
||||||
|
float yawStartTolerance = YAW_START_RANGE
|
||||||
|
* (1.f - gyroCameraSensitivity)
|
||||||
|
+ (2.f * CAMERA_STOP_TOLERANCE_DEGREES);
|
||||||
|
|
||||||
float cameraHeadAngleDifference = glm::length(glm::vec2(_pitch - _cameraPitch, _yaw - _cameraYaw));
|
float cameraHeadAngleDifference = glm::length(glm::vec2(_pitch - _cameraPitch, _yaw - _cameraYaw));
|
||||||
if (_isCameraMoving) {
|
if (_isCameraMoving) {
|
||||||
|
|
Loading…
Reference in a new issue