This commit is contained in:
Jeffrey Ventrella 2013-05-31 16:58:58 -07:00
parent 4f49f1769e
commit d92471860d
2 changed files with 3 additions and 4 deletions

View file

@ -892,7 +892,7 @@ void Avatar::render(bool lookingInMirror) {
}
}
void Avatar::initializeBodySprings() {
void Avatar::resetBodySprings() {
for (int b = 0; b < NUM_AVATAR_JOINTS; b++) {
_ball[b].position = _skeleton.joint[b].position;
_ball[b].velocity = glm::vec3(0.0f, 0.0f, 0.0f);
@ -903,7 +903,7 @@ void Avatar::updateBodySprings(float deltaTime) {
// Check for a large repositioning, and re-initialize body springs if this has happened
const float BEYOND_BODY_SPRING_RANGE = 2.f;
if (glm::length(_position - _ball[AVATAR_JOINT_PELVIS].position) > BEYOND_BODY_SPRING_RANGE) {
initializeBodySprings();
resetBodySprings();
}
for (int b = 0; b < NUM_AVATAR_JOINTS; b++) {
glm::vec3 springVector(_ball[b].position);

View file

@ -152,9 +152,8 @@ private:
glm::vec3 caclulateAverageEyePosition() { return _head.caclulateAverageEyePosition(); } // get the position smack-dab between the eyes (for lookat)
glm::quat computeRotationFromBodyToWorldUp(float proportion = 1.0f) const;
void renderBody(bool lookingInMirror);
//void initializeSkeleton();
void initializeBalls();
void initializeBodySprings();
void resetBodySprings();
void updateBodySprings( float deltaTime );
void calculateBoneLengths();
void readSensors();