mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 02:33:09 +02:00
Fixed problem with springy body repositioning on startup
This commit is contained in:
parent
408a21b515
commit
2bf9b3e6fd
1 changed files with 5 additions and 0 deletions
|
@ -1249,6 +1249,11 @@ void Avatar::initializeBodySprings() {
|
|||
}
|
||||
|
||||
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 - _joint[AVATAR_JOINT_PELVIS].springyPosition) > BEYOND_BODY_SPRING_RANGE) {
|
||||
initializeBodySprings();
|
||||
}
|
||||
for (int b = 0; b < NUM_AVATAR_JOINTS; b++) {
|
||||
glm::vec3 springVector(_joint[b].springyPosition);
|
||||
|
||||
|
|
Loading…
Reference in a new issue