mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 19:03:07 +02:00
oops, forgot to add entities to Bullet simulation
This commit is contained in:
parent
a21ebe4f6a
commit
9f11121df2
1 changed files with 7 additions and 3 deletions
|
@ -50,7 +50,6 @@ void PhysicsEngine::updateEntities(QSet<EntityItem*>& entitiesToDelete) {
|
||||||
updateObject(motionState, entity->getUpdateFlags());
|
updateObject(motionState, entity->getUpdateFlags());
|
||||||
}
|
}
|
||||||
entity->clearUpdateFlags();
|
entity->clearUpdateFlags();
|
||||||
// TODO: implement this
|
|
||||||
++item_itr;
|
++item_itr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,11 +80,16 @@ void PhysicsEngine::addEntity(EntityItem* entity) {
|
||||||
assert(entity);
|
assert(entity);
|
||||||
void* physicsInfo = entity->getPhysicsInfo();
|
void* physicsInfo = entity->getPhysicsInfo();
|
||||||
if (!physicsInfo) {
|
if (!physicsInfo) {
|
||||||
EntityMotionState* motionState = new EntityMotionState(entity);
|
|
||||||
entity->setPhysicsInfo(static_cast<void*>(motionState));
|
|
||||||
if (entity->isMortal()) {
|
if (entity->isMortal()) {
|
||||||
_mortalEntities.insert(entity);
|
_mortalEntities.insert(entity);
|
||||||
}
|
}
|
||||||
|
EntityMotionState* motionState = new EntityMotionState(entity);
|
||||||
|
if (addObject(motionState)) {
|
||||||
|
entity->setPhysicsInfo(static_cast<void*>(motionState));
|
||||||
|
} else {
|
||||||
|
// We failed to add the object to the simulation. Probably because we couldn't create a shape for it.
|
||||||
|
delete motionState;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue