mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:51:20 +02:00
Merge pull request #13998 from AndrewMeadows/dont-zero-kinematic
don't zero kinematic velocities when releasing simulation ownership
This commit is contained in:
commit
49e578ebef
2 changed files with 3 additions and 3 deletions
|
@ -446,8 +446,9 @@ bool EntityMotionState::shouldSendUpdate(uint32_t simulationStep) {
|
||||||
|
|
||||||
void EntityMotionState::updateSendVelocities() {
|
void EntityMotionState::updateSendVelocities() {
|
||||||
if (!_body->isActive()) {
|
if (!_body->isActive()) {
|
||||||
// make sure all derivatives are zero
|
if (!_body->isKinematicObject()) {
|
||||||
clearObjectVelocities();
|
clearObjectVelocities();
|
||||||
|
}
|
||||||
// we pretend we sent the inactive update for this object
|
// we pretend we sent the inactive update for this object
|
||||||
_numInactiveUpdates = 1;
|
_numInactiveUpdates = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -138,7 +138,6 @@ void PhysicalEntitySimulation::changeEntityInternal(EntityItemPointer entity) {
|
||||||
btRigidBody* body = motionState->getRigidBody();
|
btRigidBody* body = motionState->getRigidBody();
|
||||||
if (body) {
|
if (body) {
|
||||||
body->forceActivationState(ISLAND_SLEEPING);
|
body->forceActivationState(ISLAND_SLEEPING);
|
||||||
motionState->updateSendVelocities(); // has side-effect of zeroing entity velocities for inactive body
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// send packet to remove ownership
|
// send packet to remove ownership
|
||||||
|
|
Loading…
Reference in a new issue