mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
reverting a change to try to see sticking problem again
This commit is contained in:
parent
f96e9eb1e8
commit
ac99005602
1 changed files with 13 additions and 1 deletions
|
@ -80,7 +80,19 @@ void ObjectMotionState::setBodyGravity(const glm::vec3& gravity) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 ObjectMotionState::getBodyLinearVelocity() 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 {
|
glm::vec3 ObjectMotionState::getObjectLinearVelocityChange() const {
|
||||||
|
|
Loading…
Reference in a new issue