mirror of
https://github.com/lubosz/overte.git
synced 2025-04-27 09:15:32 +02:00
Merge pull request #12825 from AndrewMeadows/workload
only add to physics simulation that when necessary
This commit is contained in:
commit
f996989a40
1 changed files with 3 additions and 1 deletions
|
@ -48,7 +48,9 @@ void PhysicalEntitySimulation::addEntityInternal(EntityItemPointer entity) {
|
|||
QMutexLocker lock(&_mutex);
|
||||
assert(entity);
|
||||
assert(!entity->isDead());
|
||||
if (entity->shouldBePhysical()) {
|
||||
uint8_t region = _space->getRegion(entity->getSpaceIndex());
|
||||
bool shouldBePhysical = region < workload::Region::R3 && entity->shouldBePhysical();
|
||||
if (shouldBePhysical) {
|
||||
EntityMotionState* motionState = static_cast<EntityMotionState*>(entity->getPhysicsInfo());
|
||||
if (!motionState) {
|
||||
_entitiesToAddToPhysics.insert(entity);
|
||||
|
|
Loading…
Reference in a new issue