mirror of
https://github.com/lubosz/overte.git
synced 2025-04-15 19:47:38 +02:00
comments and more readable code
This commit is contained in:
parent
f44551e957
commit
2da0714e36
1 changed files with 12 additions and 1 deletions
|
@ -203,7 +203,18 @@ bool SafeLanding::isEntityPhysicsReady(const EntityItemPointer& entity) {
|
|||
if (hasAABox && downloadedCollisionTypes.count(modelEntity->getShapeType()) != 0) {
|
||||
auto space = _entityTreeRenderer->getWorkloadSpace();
|
||||
uint8_t region = space ? space->getRegion(entity->getSpaceIndex()) : (uint8_t)workload::Region::INVALID;
|
||||
bool definitelyNotPhysical = (region > workload::Region::R2 && region < workload::Region::UNKNOWN) ||
|
||||
|
||||
// Note: the meanings of the workload regions are:
|
||||
// R1 = in physics simulation and willing to own simulation
|
||||
// R2 = in physics simulation but does NOT want to own simulation
|
||||
// R3 = not in physics simulation but kinematically animated when velocities are non-zero
|
||||
// R4 = sorted by workload and found to be outside R3
|
||||
// UNKNOWN = known to workload but not yet sorted
|
||||
// INVALID = not known to workload
|
||||
// So any entity sorted into R3 or R4 is definitelyNotPhysical
|
||||
|
||||
bool definitelyNotPhysical = region == workload::Region::R2 ||
|
||||
region == workload::Region::R4 ||
|
||||
!entity->shouldBePhysical() ||
|
||||
modelEntity->unableToLoadCollisionShape();
|
||||
bool definitelyPhysical = entity->isInPhysicsSimulation();
|
||||
|
|
Loading…
Reference in a new issue