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

Function _scopeCallback

Engine/source/scene/sceneManager.cpp:524–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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