Camera always stops moving when using gyro's

This commit is contained in:
Philip Rosedale 2013-08-07 14:08:30 -07:00
parent 8ab36c87d7
commit 0d26bb4266
2 changed files with 7 additions and 2 deletions

View file

@ -51,6 +51,7 @@ public:
void lowPassFilter(int16_t* inputBuffer);
void startCollisionSound(float magnitude, float frequency, float noise, float duration);
float getCollisionSoundMagnitude() { return _collisionSoundMagnitude; };
int getSongFileBytes() { return _songFileBytes; }

View file

@ -238,8 +238,12 @@ void Head::simulate(float deltaTime, bool isMine, float gyroCameraSensitivity) {
const float CAMERA_STOP_TOLERANCE_DEGREES = 0.5f;
const float PITCH_START_RANGE = 20.f;
const float YAW_START_RANGE = 10.f;
float pitchStartTolerance = PITCH_START_RANGE * (1.f - gyroCameraSensitivity);
float yawStartTolerance = YAW_START_RANGE * (1.f - gyroCameraSensitivity);
float pitchStartTolerance = PITCH_START_RANGE
* (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));
if (_isCameraMoving) {