MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _onZoneAddObject

Method _onZoneAddObject

Engine/source/scene/zones/sceneZoneSpace.cpp:147–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145//-----------------------------------------------------------------------------
146
147void SceneZoneSpace::_onZoneAddObject( SceneObject* object, const U32* zoneIDs, U32 numZones )
148{
149 if( object->isVisualOccluder() )
150 _addOccluder( object );
151
152 // If this isn't the root zone and the object is zone space,
153 // see if we should automatically connect the two.
154
155 if( !isRootZone() && object->getTypeMask() & ZoneObjectType )
156 {
157 SceneZoneSpace* zoneSpace = dynamic_cast< SceneZoneSpace* >( object );
158
159 // Don't connect a zone space that has the same closed off status
160 // that we have except it is assigned to the same zone group.
161
162 if( zoneSpace &&
163 ( zoneSpace->mZoneFlags.test( ZoneFlag_IsClosedOffSpace ) != mZoneFlags.test( ZoneFlag_IsClosedOffSpace ) ||
164 ( zoneSpace->getZoneGroup() == getZoneGroup() &&
165 zoneSpace->getZoneGroup() != InvalidZoneGroup ) ) &&
166 _automaticallyConnectZoneSpace( zoneSpace ) )
167 {
168 connectZoneSpace( zoneSpace );
169 }
170 }
171}
172
173//-----------------------------------------------------------------------------
174

Callers 2

_zoneInsertMethod · 0.80
_addToOutdoorZoneMethod · 0.80

Calls 4

isVisualOccluderMethod · 0.80
getTypeMaskMethod · 0.80
getZoneGroupMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected