mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 16:26:17 +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());
|
||||
}
|
||||
entity->clearUpdateFlags();
|
||||
// TODO: implement this
|
||||
++item_itr;
|
||||
}
|
||||
|
||||
|
@ -81,11 +80,16 @@ void PhysicsEngine::addEntity(EntityItem* entity) {
|
|||
assert(entity);
|
||||
void* physicsInfo = entity->getPhysicsInfo();
|
||||
if (!physicsInfo) {
|
||||
EntityMotionState* motionState = new EntityMotionState(entity);
|
||||
entity->setPhysicsInfo(static_cast<void*>(motionState));
|
||||
if (entity->isMortal()) {
|
||||
_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