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

Method scopeScene

Engine/source/scene/sceneManager.cpp:548–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548void SceneManager::scopeScene( CameraScopeQuery* query, NetConnection* netConnection )
549{
550 PROFILE_SCOPE( SceneGraph_scopeScene );
551
552 // Note that this method does not use the zoning information in the scene
553 // to scope objects. The reason is that with the way that scoping is implemented
554 // in the networking layer--i.e. by killing off ghosts of objects that are out
555 // of scope--, it doesn't make sense to let, for example, all objects in the outdoor
556 // zone go out of scope, just because there is no exterior portal that is visible from
557 // the current camera viewpoint (in any direction).
558 //
559 // So, we perform a simple box query on the area covered by the camera query
560 // and then scope in everything that is in range.
561
562 // Set up scoping info.
563
564 ScopingInfo info;
565
566 info.scopePoint = query->pos;
567 info.scopeDist = query->visibleDistance;
568 info.scopeDistSquared = info.scopeDist * info.scopeDist;
569 info.connection = netConnection;
570
571 // Scope all objects in the query area.
572
573 Box3F area( query->visibleDistance );
574 area.setCenter( query->pos );
575
576 getContainer()->findObjects( area, 0xFFFFFFFF, _scopeCallback, &info );
577}
578
579//-----------------------------------------------------------------------------
580

Callers 1

onCameraScopeQueryMethod · 0.80

Calls 3

setCenterMethod · 0.80
findObjectsMethod · 0.80
getContainerFunction · 0.50

Tested by

no test coverage detected