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

Method onCameraScopeQuery

Engine/source/sim/netObject.cpp:340–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340void NetObject::onCameraScopeQuery(NetConnection *cr, CameraScopeQuery* /*camInfo*/)
341{
342 // default behavior -
343 // ghost everything that is ghostable
344
345 for (SimSetIterator obj(Sim::getRootGroup()); *obj; ++obj)
346 {
347 NetObject* nobj = dynamic_cast<NetObject*>(*obj);
348 if (nobj)
349 {
350 AssertFatal(!nobj->mNetFlags.test(NetObject::Ghostable) || !nobj->mNetFlags.test(NetObject::IsGhost),
351 "NetObject::onCameraScopeQuery: object marked both ghostable and as ghost");
352
353 // Some objects don't ever want to be ghosted
354 if (!nobj->mNetFlags.test(NetObject::Ghostable))
355 continue;
356 if (!nobj->mNetFlags.test(NetObject::ScopeAlways))
357 {
358 // it's in scope...
359 cr->objectInScope(nobj);
360 }
361 }
362 }
363}
364
365//-----------------------------------------------------------------------------
366

Callers 1

ghostWritePacketMethod · 0.45

Calls 3

getRootGroupFunction · 0.85
objectInScopeMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected