| 669 | } |
| 670 | |
| 671 | void SceneObject::onCameraScopeQuery( NetConnection* connection, CameraScopeQuery* query ) |
| 672 | { |
| 673 | SceneManager* sceneManager = getSceneManager(); |
| 674 | GameConnection* conn = dynamic_cast<GameConnection*> (connection); |
| 675 | if (conn && (query->visibleDistance = conn->getVisibleGhostDistance()) == 0.0f) |
| 676 | if ((query->visibleDistance = sceneManager->getVisibleGhostDistance()) == 0.0f) |
| 677 | query->visibleDistance = sceneManager->getVisibleDistance(); |
| 678 | |
| 679 | // Object itself is in scope. |
| 680 | |
| 681 | if( this->isScopeable() ) |
| 682 | connection->objectInScope( this ); |
| 683 | |
| 684 | // If we're mounted to something, that object is in scope too. |
| 685 | |
| 686 | if( isMounted() ) |
| 687 | connection->objectInScope( mMount.object ); |
| 688 | |
| 689 | // If we're added to a scene graph, let the graph do the scene scoping. |
| 690 | // Otherwise just put everything in the server container in scope. |
| 691 | |
| 692 | if( getSceneManager() ) |
| 693 | getSceneManager()->scopeScene( query, connection ); |
| 694 | else |
| 695 | gServerContainer.findObjects( 0xFFFFFFFF, scopeCallback, connection ); |
| 696 | } |
| 697 | |
| 698 | //----------------------------------------------------------------------------- |
| 699 |
nothing calls this directly
no test coverage detected