mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 00:30:52 +02:00
update avatar collision shapes when necessary
This commit is contained in:
parent
1986ac6be3
commit
5992651c27
1 changed files with 11 additions and 10 deletions
|
@ -335,7 +335,8 @@ void MyAvatar::simulate(float deltaTime) {
|
|||
radius = myCamera->getAspectRatio() * (myCamera->getNearClip() / cos(myCamera->getFieldOfView() / 2.0f));
|
||||
radius *= COLLISION_RADIUS_SCALAR;
|
||||
}
|
||||
|
||||
if (_collisionFlags) {
|
||||
updateShapePositions();
|
||||
if (_collisionFlags & COLLISION_GROUP_ENVIRONMENT) {
|
||||
updateCollisionWithEnvironment(deltaTime, radius);
|
||||
}
|
||||
|
@ -346,6 +347,7 @@ void MyAvatar::simulate(float deltaTime) {
|
|||
updateCollisionWithAvatars(deltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// consider updating our billboard
|
||||
maybeUpdateBillboard();
|
||||
|
@ -914,7 +916,6 @@ void MyAvatar::updateCollisionWithAvatars(float deltaTime) {
|
|||
// no need to compute a bunch of stuff if we have one or fewer avatars
|
||||
return;
|
||||
}
|
||||
updateShapePositions();
|
||||
float myBoundingRadius = getBoundingRadius();
|
||||
|
||||
const float BODY_COLLISION_RESOLUTION_FACTOR = glm::max(1.0f, deltaTime / BODY_COLLISION_RESOLUTION_TIMESCALE);
|
||||
|
|
Loading…
Reference in a new issue