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

Function _scopeCallback

Engine/source/scene/sceneManager.cpp:525–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523};
524
525static void _scopeCallback( SceneObject* object, void* data )
526{
527 if( !object->isScopeable() )
528 return;
529
530 ScopingInfo* info = reinterpret_cast< ScopingInfo* >( data );
531 NetConnection* connection = info->connection;
532
533 F32 difSq = ( object->getWorldSphere().center - info->scopePoint ).lenSquared();
534 if( difSq < info->scopeDistSquared )
535 {
536 // Not even close, it's in...
537 connection->objectInScope( object );
538 }
539 else
540 {
541 // Check a little more closely...
542 F32 realDif = mSqrt( difSq );
543 if( realDif - object->getWorldSphere().radius < info->scopeDist)
544 connection->objectInScope( object );
545 }
546}
547
548void SceneManager::scopeScene( CameraScopeQuery* query, NetConnection* netConnection )
549{

Callers

nothing calls this directly

Calls 4

mSqrtFunction · 0.85
isScopeableMethod · 0.80
objectInScopeMethod · 0.80
lenSquaredMethod · 0.45

Tested by

no test coverage detected