Browse Source

- Scene controllers WIP.

MelvMay-GG 12 years ago
parent
commit
8cbae47

+ 11 - 0
engine/source/2d/controllers/PointForceController.cc

@@ -124,3 +124,14 @@ void PointForceController::integrate( Scene* pScene, const F32 totalTime, const
         pSceneObject->applyForce( forceDirection, true );
         pSceneObject->applyForce( forceDirection, true );
     }
     }
 }
 }
+
+//------------------------------------------------------------------------------
+
+void PointForceController::renderOverlay( Scene* pScene, const SceneRenderState* pSceneRenderState, BatchRender* pBatchRenderer )
+{
+    // Call parent.
+    Parent::renderOverlay( pScene, pSceneRenderState, pBatchRenderer );
+
+    // Draw camera pause distance.
+    pScene->mDebugDraw.DrawCircle( mPosition, mRadius, b2Color(1.0f, 1.0f, 0.0f ) );
+}

+ 3 - 0
engine/source/2d/controllers/PointForceController.h

@@ -52,6 +52,9 @@ public:
     /// Integration.
     /// Integration.
     virtual void integrate( Scene* pScene, const F32 totalTime, const F32 elapsedTime, DebugStats* pDebugStats );
     virtual void integrate( Scene* pScene, const F32 totalTime, const F32 elapsedTime, DebugStats* pDebugStats );
 
 
+    // Scene render.
+    virtual void renderOverlay( Scene* pScene, const SceneRenderState* pSceneRenderState, BatchRender* pBatchRenderer );
+
     inline void setForce( const F32& force ) { mForce = force; }
     inline void setForce( const F32& force ) { mForce = force; }
     inline const F32 getForce( void ) const { return mForce; }
     inline const F32 getForce( void ) const { return mForce; }
 
 

+ 1 - 1
engine/source/2d/controllers/SceneController.h

@@ -64,7 +64,7 @@ public:
     virtual void integrate( Scene* pScene, const F32 totalTime, const F32 elapsedTime, DebugStats* pDebugStats ) {}
     virtual void integrate( Scene* pScene, const F32 totalTime, const F32 elapsedTime, DebugStats* pDebugStats ) {}
 
 
     // Scene render.
     // Scene render.
-    virtual void sceneRender( const SceneRenderState* pSceneRenderState, BatchRender* pBatchRenderer ) {}
+    virtual void renderOverlay( Scene* pScene, const SceneRenderState* pSceneRenderState, BatchRender* pBatchRenderer ) {}
 
 
     /// Declare Console Object.
     /// Declare Console Object.
     DECLARE_CONOBJECT( SceneController );
     DECLARE_CONOBJECT( SceneController );

+ 2 - 2
engine/source/2d/scene/Scene.cc

@@ -1245,8 +1245,8 @@ void Scene::sceneRender( const SceneRenderState* pSceneRenderState )
 			    if ( pController == NULL )
 			    if ( pController == NULL )
 				    continue;
 				    continue;
 
 
-			    // Integrate.
-                pController->sceneRender( pSceneRenderState, &mBatchRenderer );
+			    // Render the overlay.
+                pController->renderOverlay( this, pSceneRenderState, &mBatchRenderer );
 		    }
 		    }
 
 
             // Flush isolated batch.
             // Flush isolated batch.