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