reverting a change to try to see sticking problem again

This commit is contained in:
Seth Alves 2015-10-19 12:13:08 -07:00
parent f96e9eb1e8
commit ac99005602

View file

@ -80,7 +80,19 @@ void ObjectMotionState::setBodyGravity(const glm::vec3& gravity) const {
}
glm::vec3 ObjectMotionState::getBodyLinearVelocity() const {
return bulletToGLM(_body->getLinearVelocity());
btVector3 velocity = _body->getLinearVelocity();
// NOTE: the threshold to use here relates to the linear displacement threshold (dX) for sending updates
// to objects that are tracked server-side (e.g. entities which use dX = 2mm). Hence an object moving
// just under this velocity threshold would trigger an update about V/dX times per second.
const float MIN_LINEAR_SPEED_SQUARED = 0.0036f; // 6 mm/sec
if (velocity.length2() < MIN_LINEAR_SPEED_SQUARED) {
velocity *= 0.0f;
}
return bulletToGLM(velocity);
// return bulletToGLM(_body->getLinearVelocity());
}
glm::vec3 ObjectMotionState::getObjectLinearVelocityChange() const {