mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-08-16 15:50:55 +02:00
Merge pull request #254 from PhilipRosedale/master
Fixed bug with bodies springing into view on startup
This commit is contained in:
commit
a476c8362c
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