mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:37:51 +02:00
Merge pull request #4152 from ZappoMan/fixGlitches
Fix glitches in bullets and multiple viewers
This commit is contained in:
commit
355759d3d4
1 changed files with 10 additions and 0 deletions
|
@ -108,6 +108,16 @@ bool ObjectMotionState::doesNotNeedToSendUpdate() const {
|
||||||
|
|
||||||
bool ObjectMotionState::shouldSendUpdate(uint32_t simulationFrame) {
|
bool ObjectMotionState::shouldSendUpdate(uint32_t simulationFrame) {
|
||||||
assert(_body);
|
assert(_body);
|
||||||
|
|
||||||
|
// if we've never checked before, our _sentFrame will be 0, and we need to initialize our state
|
||||||
|
if (_sentFrame == 0) {
|
||||||
|
_sentPosition = bulletToGLM(_body->getWorldTransform().getOrigin());
|
||||||
|
_sentVelocity = bulletToGLM(_body->getLinearVelocity());
|
||||||
|
_sentAngularVelocity = bulletToGLM(_body->getAngularVelocity());
|
||||||
|
_sentFrame = simulationFrame;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
float dt = (float)(simulationFrame - _sentFrame) * PHYSICS_ENGINE_FIXED_SUBSTEP;
|
float dt = (float)(simulationFrame - _sentFrame) * PHYSICS_ENGINE_FIXED_SUBSTEP;
|
||||||
_sentFrame = simulationFrame;
|
_sentFrame = simulationFrame;
|
||||||
bool isActive = _body->isActive();
|
bool isActive = _body->isActive();
|
||||||
|
|
Loading…
Reference in a new issue