| 578 | //----------------------------------------------------------------------------- |
| 579 | |
| 580 | bool SceneManager::addObjectToScene( SceneObject* object ) |
| 581 | { |
| 582 | AssertFatal( !object->mSceneManager, "SceneManager::addObjectToScene - Object already part of a scene" ); |
| 583 | |
| 584 | // Mark the object as belonging to us. |
| 585 | |
| 586 | object->mSceneManager = this; |
| 587 | |
| 588 | // Register with managers except its the root zone. |
| 589 | |
| 590 | if( !dynamic_cast< SceneRootZone* >( object ) ) |
| 591 | { |
| 592 | // Add to container. |
| 593 | |
| 594 | getContainer()->addObject( object ); |
| 595 | |
| 596 | // Register the object with the zone manager. |
| 597 | |
| 598 | if( getZoneManager() ) |
| 599 | getZoneManager()->registerObject( object ); |
| 600 | } |
| 601 | |
| 602 | // Notify the object. |
| 603 | |
| 604 | return object->onSceneAdd(); |
| 605 | } |
| 606 | |
| 607 | //----------------------------------------------------------------------------- |
| 608 |
no test coverage detected