remove unused setHeadFromGyros() routine - confusing.

This commit is contained in:
Philip Rosedale 2013-06-05 10:46:55 -07:00
parent 5fbf9f8714
commit b38c68ab20
3 changed files with 3 additions and 32 deletions

View file

@ -1220,37 +1220,6 @@ void Avatar::renderBody(bool lookingInMirror) {
void Avatar::setHeadFromGyros(glm::vec3* eulerAngles, glm::vec3* angularVelocity, float deltaTime, float smoothingTime) {
//
// Given absolute position and angular velocity information, update the avatar's head angles
// with the goal of fast instantaneous updates that gradually follow the absolute data.
//
// Euler Angle format is (Yaw, Pitch, Roll) in degrees
//
// Angular Velocity is (Yaw, Pitch, Roll) in degrees per second
//
// SMOOTHING_TIME is the time is seconds over which the head should average to the
// absolute eulerAngles passed.
//
//
if (deltaTime == 0.f) {
// On first sample, set head to absolute position
_head.setYaw (eulerAngles->x);
_head.setPitch(eulerAngles->y);
_head.setRoll (eulerAngles->z);
} else {
glm::vec3 angles(_head.getYaw(), _head.getPitch(), _head.getRoll());
// Increment by detected velocity
angles += (*angularVelocity) * deltaTime;
// Smooth to slowly follow absolute values
angles = ((1.f - deltaTime / smoothingTime) * angles) + (deltaTime / smoothingTime) * (*eulerAngles);
_head.setYaw (angles.x);
_head.setPitch(angles.y);
_head.setRoll (angles.z);
// printLog("Y/P/R: %3.1f, %3.1f, %3.1f\n", angles.x, angles.y, angles.z);
}
}
void Avatar::loadData(QSettings* set) { void Avatar::loadData(QSettings* set) {
set->beginGroup("Avatar"); set->beginGroup("Avatar");

View file

@ -216,7 +216,6 @@ private:
void updateCollisionWithVoxels(); void updateCollisionWithVoxels();
void applyCollisionWithScene(const glm::vec3& penetration); void applyCollisionWithScene(const glm::vec3& penetration);
void applyCollisionWithOtherAvatar( Avatar * other, float deltaTime ); void applyCollisionWithOtherAvatar( Avatar * other, float deltaTime );
void setHeadFromGyros(glm::vec3 * eulerAngles, glm::vec3 * angularVelocity, float deltaTime, float smoothingTime);
void checkForMouseRayTouching(); void checkForMouseRayTouching();
void renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, float radius1, float radius2); void renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, float radius1, float radius2);
}; };

View file

@ -104,6 +104,7 @@ void Head::simulate(float deltaTime, bool isMine) {
const float HEAD_MOTION_DECAY = 0.00; const float HEAD_MOTION_DECAY = 0.00;
/*
// Decay head back to center if turned on // Decay head back to center if turned on
if (isMine && _returnHeadToCenter) { if (isMine && _returnHeadToCenter) {
@ -121,6 +122,7 @@ void Head::simulate(float deltaTime, bool isMine) {
if (fabs(_yaw ) < RETURN_RANGE) { _yaw *= (1.0f - RETURN_STRENGTH * deltaTime); } if (fabs(_yaw ) < RETURN_RANGE) { _yaw *= (1.0f - RETURN_STRENGTH * deltaTime); }
if (fabs(_roll ) < RETURN_RANGE) { _roll *= (1.0f - RETURN_STRENGTH * deltaTime); } if (fabs(_roll ) < RETURN_RANGE) { _roll *= (1.0f - RETURN_STRENGTH * deltaTime); }
} }
*/
// decay lean // decay lean
_leanForward *= (1.f - HEAD_MOTION_DECAY * 30 * deltaTime); _leanForward *= (1.f - HEAD_MOTION_DECAY * 30 * deltaTime);
@ -151,6 +153,7 @@ void Head::simulate(float deltaTime, bool isMine) {
if (USING_PHYSICAL_MOHAWK) { if (USING_PHYSICAL_MOHAWK) {
updateHairPhysics(deltaTime); updateHairPhysics(deltaTime);
} }
} }
void Head::determineIfLookingAtSomething() { void Head::determineIfLookingAtSomething() {