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

Method onCameraScopeQuery

Engine/source/sim/netObject.cpp:326–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void NetObject::onCameraScopeQuery(NetConnection *cr, CameraScopeQuery* /*camInfo*/)
327{
328 // default behavior -
329 // ghost everything that is ghostable
330
331 for (SimSetIterator obj(Sim::getRootGroup()); *obj; ++obj)
332 {
333 NetObject* nobj = dynamic_cast<NetObject*>(*obj);
334 if (nobj)
335 {
336 AssertFatal(!nobj->mNetFlags.test(NetObject::Ghostable) || !nobj->mNetFlags.test(NetObject::IsGhost),
337 "NetObject::onCameraScopeQuery: object marked both ghostable and as ghost");
338
339 // Some objects don't ever want to be ghosted
340 if (!nobj->mNetFlags.test(NetObject::Ghostable))
341 continue;
342 if (!nobj->mNetFlags.test(NetObject::ScopeAlways))
343 {
344 // it's in scope...
345 cr->objectInScope(nobj);
346 }
347 }
348 }
349}
350
351//-----------------------------------------------------------------------------
352

Callers 1

ghostWritePacketMethod · 0.45

Calls 3

getRootGroupFunction · 0.85
objectInScopeMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected