mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
when removing something from bullet, attempt to wake up anything that was touching it
This commit is contained in:
parent
07a848c9ce
commit
96b4517e6e
5 changed files with 9 additions and 8 deletions
|
@ -61,8 +61,6 @@ public:
|
|||
|
||||
void clearEntities();
|
||||
|
||||
virtual void bump(EntityItem* bumpEntity) {}
|
||||
|
||||
EntityTree* getEntityTree() { return _entityTree; }
|
||||
|
||||
signals:
|
||||
|
|
|
@ -269,9 +269,6 @@ void EntityTree::deleteEntity(const EntityItemID& entityID, bool force, bool ign
|
|||
return;
|
||||
}
|
||||
|
||||
// in case something is resting on top of this, give it a bump in the simulation.
|
||||
_simulation->bump(existingEntity);
|
||||
|
||||
if (existingEntity->getLocked() && !force) {
|
||||
if (!ignoreWarnings) {
|
||||
qCDebug(entities) << "ERROR! EntityTree::deleteEntity() trying to delete locked entity. entityID=" << entityID;
|
||||
|
|
|
@ -328,8 +328,6 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, uint32_
|
|||
qCDebug(physics) << "EntityMotionState::sendUpdate()... calling queueEditEntityMessage()...";
|
||||
#endif
|
||||
|
||||
qDebug() << "sending";
|
||||
|
||||
entityPacketSender->queueEditEntityMessage(PacketTypeEntityAddOrEdit, id, properties);
|
||||
} else {
|
||||
#ifdef WANT_DEBUG
|
||||
|
|
|
@ -386,9 +386,15 @@ void PhysicsEngine::bump(EntityItem* bumpEntity) {
|
|||
if (entityA && entityB) {
|
||||
if (entityA == bumpEntity) {
|
||||
entityB->setShouldClaimSimulationOwnership(true);
|
||||
if (!objectB->isActive()) {
|
||||
objectB->setActivationState(ACTIVE_TAG);
|
||||
}
|
||||
}
|
||||
if (entityB == bumpEntity) {
|
||||
entityA->setShouldClaimSimulationOwnership(true);
|
||||
if (!objectA->isActive()) {
|
||||
objectA->setActivationState(ACTIVE_TAG);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -564,6 +570,8 @@ void PhysicsEngine::addObject(const ShapeInfo& shapeInfo, btCollisionShape* shap
|
|||
|
||||
void PhysicsEngine::removeObjectFromBullet(ObjectMotionState* motionState) {
|
||||
assert(motionState);
|
||||
EntityItem* entity = static_cast<EntityMotionState*>(motionState)->getEntity();
|
||||
bump(entity);
|
||||
btRigidBody* body = motionState->getRigidBody();
|
||||
if (body) {
|
||||
const btCollisionShape* shape = body->getCollisionShape();
|
||||
|
|
|
@ -68,7 +68,6 @@ public:
|
|||
|
||||
void stepSimulation();
|
||||
void stepNonPhysicalKinematics(const quint64& now);
|
||||
virtual void bump(EntityItem* bumpEntity);
|
||||
void computeCollisionEvents();
|
||||
|
||||
void dumpStatsIfNecessary();
|
||||
|
@ -99,6 +98,7 @@ private:
|
|||
// return 'true' of update was successful
|
||||
bool updateObjectHard(btRigidBody* body, ObjectMotionState* motionState, uint32_t flags);
|
||||
void updateObjectEasy(btRigidBody* body, ObjectMotionState* motionState, uint32_t flags);
|
||||
void bump(EntityItem* bumpEntity);
|
||||
|
||||
btClock _clock;
|
||||
btDefaultCollisionConfiguration* _collisionConfig = NULL;
|
||||
|
|
Loading…
Reference in a new issue