mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
followuup to #837378a -safety checks for select within zone
This commit is contained in:
parent
482b179baa
commit
ef264083ae
1 changed files with 16 additions and 16 deletions
|
|
@ -103,27 +103,27 @@ bool Zone::_doSelect(void* object, const char* index, const char* data)
|
||||||
void Zone::selectWithin()
|
void Zone::selectWithin()
|
||||||
{
|
{
|
||||||
SimpleQueryList sql;
|
SimpleQueryList sql;
|
||||||
//getContainer()->polyhedronFindObjects(getPolyhedron(), 0xFFFFFFFF, SimpleQueryList::insertionCallback, &sql);
|
|
||||||
|
|
||||||
//replace the above with this once we stort out how to look up the managed zoneID from the insatnce itself
|
|
||||||
Zone* zoneClient = (Zone*)getClientObject();
|
Zone* zoneClient = (Zone*)getClientObject();
|
||||||
SceneZoneSpaceManager* zoneManager = zoneClient->getSceneManager()->getZoneManager();
|
if (zoneClient)
|
||||||
if (zoneManager)
|
|
||||||
{
|
{
|
||||||
for (U32 zoneId = zoneClient->mZoneRangeStart; zoneId < zoneClient->mZoneRangeStart + zoneClient->mNumZones; ++zoneId)
|
SceneZoneSpaceManager* zoneManager = zoneClient->getSceneManager()->getZoneManager();
|
||||||
for (SceneZoneSpaceManager::ZoneContentIterator iter(zoneManager, zoneId, false); iter.isValid(); ++iter)
|
if (zoneManager)
|
||||||
{
|
{
|
||||||
SceneObject* obj = (SceneObject*)iter->getServerObject();
|
for (U32 zoneId = zoneClient->mZoneRangeStart; zoneId < zoneClient->mZoneRangeStart + zoneClient->mNumZones; ++zoneId)
|
||||||
bool fullyEnclosed = true;
|
for (SceneZoneSpaceManager::ZoneContentIterator iter(zoneManager, zoneId, false); iter.isValid(); ++iter)
|
||||||
|
|
||||||
for (SceneObject::ObjectZonesIterator zoneIter(obj); zoneIter.isValid(); ++zoneIter)
|
|
||||||
{
|
{
|
||||||
if (*zoneIter != zoneId);
|
SceneObject* obj = (SceneObject*)iter->getServerObject();
|
||||||
|
bool fullyEnclosed = true;
|
||||||
|
|
||||||
|
for (SceneObject::ObjectZonesIterator zoneIter(obj); zoneIter.isValid(); ++zoneIter)
|
||||||
|
{
|
||||||
|
if (*zoneIter != zoneId);
|
||||||
fullyEnclosed = false;
|
fullyEnclosed = false;
|
||||||
|
}
|
||||||
|
if (fullyEnclosed)
|
||||||
|
sql.insertObject(obj);
|
||||||
}
|
}
|
||||||
if (fullyEnclosed)
|
}
|
||||||
sql.insertObject(obj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue