| 2476 | } |
| 2477 | |
| 2478 | void WorldEditor::renderScene( const RectI &updateRect ) |
| 2479 | { |
| 2480 | GFXDEBUGEVENT_SCOPE( Editor_renderScene, ColorI::RED ); |
| 2481 | |
| 2482 | smRenderSceneSignal.trigger(this); |
| 2483 | |
| 2484 | if (mActiveEditorTool != nullptr) |
| 2485 | mActiveEditorTool->render(); |
| 2486 | |
| 2487 | // Grab this before anything here changes it. |
| 2488 | Frustum frustum; |
| 2489 | { |
| 2490 | F32 left, right, top, bottom, nearPlane, farPlane; |
| 2491 | bool isOrtho = false; |
| 2492 | GFX->getFrustum( &left, &right, &bottom, &top, &nearPlane, &farPlane, &isOrtho ); |
| 2493 | |
| 2494 | MatrixF cameraMat = GFX->getWorldMatrix(); |
| 2495 | cameraMat.inverse(); |
| 2496 | |
| 2497 | frustum.set( isOrtho, left, right, top, bottom, nearPlane, farPlane, cameraMat ); |
| 2498 | } |
| 2499 | |
| 2500 | // Render the paths |
| 2501 | renderPaths(Scene::getRootScene()); |
| 2502 | |
| 2503 | // walk selected |
| 2504 | Selection* selection = getActiveSelectionSet(); |
| 2505 | if( selection ) |
| 2506 | { |
| 2507 | bool isMultiSelection = mSelected->size() > 1; |
| 2508 | for( U32 i = 0; i < mSelected->size(); i++ ) |
| 2509 | { |
| 2510 | if ( (const SceneObject *)mHitObject == ( *mSelected )[i] ) |
| 2511 | continue; |
| 2512 | SceneObject* object = dynamic_cast< SceneObject* >( ( *mSelected )[ i ] ); |
| 2513 | if( object && mRenderSelectionBox ) |
| 2514 | renderObjectBox( object, isMultiSelection ? mObjMultiSelectColor : mObjSelectColor ); |
| 2515 | } |
| 2516 | } |
| 2517 | |
| 2518 | // do the drag selection |
| 2519 | for ( U32 i = 0; i < mDragSelected->size(); i++ ) |
| 2520 | { |
| 2521 | SceneObject* object = dynamic_cast< SceneObject* >( ( *mDragSelected )[ i ] ); |
| 2522 | if( object && mRenderSelectionBox ) |
| 2523 | renderObjectBox(object, mObjSelectColor); |
| 2524 | } |
| 2525 | |
| 2526 | if( selection ) |
| 2527 | { |
| 2528 | // draw the mouse over obj |
| 2529 | if ( bool(mHitObject) && mRenderSelectionBox ) |
| 2530 | { |
| 2531 | ColorI & col = selection->objInSet(mHitObject) ? mObjMouseOverSelectColor : mObjMouseOverColor; |
| 2532 | renderObjectBox(mHitObject, col); |
| 2533 | } |
| 2534 | |
| 2535 | // stuff to do if there is a selection |
no test coverage detected