mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
don't call stepKinematicMotion on kinematic entities when they are children of avatars
This commit is contained in:
parent
c7200d2d3a
commit
22f9fc7061
1 changed files with 3 additions and 6 deletions
|
@ -199,15 +199,12 @@ void EntityMotionState::getWorldTransform(btTransform& worldTrans) const {
|
|||
return;
|
||||
}
|
||||
assert(entityTreeIsLocked());
|
||||
if (_motionType == MOTION_TYPE_KINEMATIC) {
|
||||
if (_motionType == MOTION_TYPE_KINEMATIC && !_entity->hasAncestorOfType(NestableType::Avatar)) {
|
||||
BT_PROFILE("kinematicIntegration");
|
||||
// This is physical kinematic motion which steps strictly by the subframe count
|
||||
// of the physics simulation and uses full gravity for acceleration.
|
||||
if (_entity->hasAncestorOfType(NestableType::Avatar)) {
|
||||
_entity->setAcceleration(glm::vec3(0.0f));
|
||||
} else {
|
||||
_entity->setAcceleration(_entity->getGravity());
|
||||
}
|
||||
_entity->setAcceleration(_entity->getGravity());
|
||||
|
||||
uint32_t thisStep = ObjectMotionState::getWorldSimulationStep();
|
||||
float dt = (thisStep - _lastKinematicStep) * PHYSICS_ENGINE_FIXED_SUBSTEP;
|
||||
_entity->stepKinematicMotion(dt);
|
||||
|
|
Loading…
Reference in a new issue