don't call stepKinematicMotion on kinematic entities

This commit is contained in:
Seth Alves 2017-02-03 15:50:59 -08:00
parent 9edaef82aa
commit 174c674fd3

View file

@ -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);