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