remove the defunct and undocumented dynamics debug renderer, to be replaced with... 64/24564/1
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 16 Jul 2014 12:18:58 +0000 (13:18 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 16 Jul 2014 12:18:58 +0000 (13:18 +0100)
[Problem] dead code
[Cause] unmaintained feature
[Solution] remove it

Change-Id: I239f7d8ba0f12e9f113e4bffbf146d198c032ba1

13 files changed:
dali/internal/event/dynamics/dynamics-world-impl.cpp
dali/internal/event/dynamics/dynamics-world-impl.h
dali/internal/file.list
dali/internal/render/common/render-manager.cpp
dali/internal/render/common/render-manager.h
dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.cpp [deleted file]
dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.h [deleted file]
dali/internal/update/dynamics/scene-graph-dynamics-world-debug.cpp [deleted file]
dali/internal/update/dynamics/scene-graph-dynamics-world-debug.h [deleted file]
dali/internal/update/dynamics/scene-graph-dynamics-world.cpp
dali/internal/update/dynamics/scene-graph-dynamics-world.h
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-manager.h

index eeea711..510487e 100644 (file)
@@ -32,7 +32,6 @@
 #include <dali/internal/event/dynamics/dynamics-collision-impl.h>
 #include <dali/internal/event/dynamics/dynamics-joint-impl.h>
 #include <dali/internal/event/dynamics/dynamics-world-config-impl.h>
-#include <dali/internal/event/effects/shader-effect-impl.h>
 #include <dali/internal/update/dynamics/scene-graph-dynamics-body.h>
 #include <dali/internal/update/dynamics/scene-graph-dynamics-world.h>
 
@@ -77,32 +76,12 @@ DynamicsWorld::DynamicsWorld(const std::string& name)
 
 void DynamicsWorld::Initialize(Stage& stage, Integration::DynamicsFactory& dynamicsFactory, DynamicsWorldConfigPtr config)
 {
-  // Create shader for debug drawing
-  const std::string debugDrawVertexShader(
-      "attribute lowp vec4 aColor;\n"
-      "varying mediump vec4 vColor;\n"
-      "void main()\n"
-      "{\n"
-      "  vColor = aColor;\n"
-      "  gl_Position = uMvpMatrix * vec4(aPosition, 1.0);\n"
-      "}\n" );
-
-  const std::string debugDrawFragmentShader(
-      "varying mediump vec4 vColor;\n"
-      "void main()\n"
-      "{\n"
-      "  gl_FragColor = vColor;\n"
-      "}\n" );
-
-  mDebugShader = ShaderEffect::New(debugDrawVertexShader, debugDrawFragmentShader, GEOMETRY_TYPE_IMAGE, Dali::ShaderEffect::HINT_NONE);
-
   mDynamicsWorld = new SceneGraph::DynamicsWorld( stage.GetDynamicsNotifier(),
                                                   stage.GetNotificationManager(),
                                                   dynamicsFactory );
 
   Integration::DynamicsWorldSettings* worldSettings( new Integration::DynamicsWorldSettings(*config->GetSettings()) );
-  const SceneGraph::Shader* shader( static_cast< const SceneGraph::Shader* >(mDebugShader->GetSceneObject()) );
-  InitializeDynamicsWorldMessage( stage.GetUpdateManager(), mDynamicsWorld, worldSettings, shader );
+  InitializeDynamicsWorldMessage( stage.GetUpdateManager(), mDynamicsWorld, worldSettings );
 
   mGravity = config->GetGravity();
 }
@@ -174,8 +153,6 @@ void DynamicsWorld::SetDebugDrawMode(const int mode)
   if( mDebugMode != mode )
   {
     mDebugMode = mode;
-
-    SetDebugDrawModeMessage( Stage::GetCurrent()->GetUpdateInterface(), *mDynamicsWorld, mDebugMode );
   }
 }
 
index 95ae35e..2a16d0f 100644 (file)
@@ -181,8 +181,6 @@ private:
 
   Dali::DynamicsWorld::CollisionSignalV2 mCollisionSignalV2;
 
-  ShaderEffectPtr mDebugShader;
-
   SlotDelegate< DynamicsWorld > mSlotDelegate;
 };
 
index a87631a..256a14d 100644 (file)
@@ -209,7 +209,6 @@ internal_dynamics_src_files = \
   $(internal_src_dir)/event/dynamics/dynamics-sphere-shape-impl.cpp \
   $(internal_src_dir)/event/dynamics/dynamics-world-config-impl.cpp \
   $(internal_src_dir)/event/dynamics/dynamics-world-impl.cpp \
-  $(internal_src_dir)/render/dynamics/scene-graph-dynamics-debug-renderer.cpp \
   $(internal_src_dir)/update/dynamics/scene-graph-dynamics-body.cpp \
   $(internal_src_dir)/update/dynamics/scene-graph-dynamics-capsule-shape.cpp \
   $(internal_src_dir)/update/dynamics/scene-graph-dynamics-cone-shape.cpp \
index d5a4058..641441f 100644 (file)
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/render-tasks/render-task.h>
 
-#ifdef DYNAMICS_SUPPORT
-#include <dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.h>
-#endif
-
 // Uncomment the next line to enable frame snapshot logging
 //#define FRAME_SNAPSHOT_LOGGING
 
@@ -155,10 +151,6 @@ struct RenderManager::Impl
   float                               frameTime;                     ///< The elapsed time since the previous frame
   float                               lastFrameTime;                 ///< Last frame delta.
 
-#ifdef DYNAMICS_SUPPORT
-  OwnerPointer<DynamicsDebugRenderer> dynamicsDebugRenderer;
-#endif
-
   unsigned int                        frameCount;          ///< The current frame count
   BufferIndex                         renderBufferIndex;   ///< The index of the buffer to read from; this is opposite of the "update" buffer
 
@@ -251,17 +243,6 @@ void RenderManager::SetFrameDeltaTime( float deltaTime )
   mImpl->frameTime = deltaTime;
 }
 
-#ifdef DYNAMICS_SUPPORT
-void RenderManager::InitializeDynamicsDebugRenderer(SceneGraph::DynamicsDebugRenderer* debugRenderer)
-{
-  if( !mImpl->dynamicsDebugRenderer )
-  {
-    mImpl->dynamicsDebugRenderer = debugRenderer;
-    debugRenderer->Initialize( mImpl->context );
-  }
-}
-#endif
-
 void RenderManager::SetDefaultSurfaceRect(const Rect<int>& rect)
 {
   mImpl->defaultSurfaceRect = rect;
@@ -402,13 +383,6 @@ bool RenderManager::Render( Integration::RenderStatus& status )
       }
     }
 
-#ifdef DYNAMICS_SUPPORT
-    if( mImpl->dynamicsDebugRenderer )
-    {
-      mImpl->dynamicsDebugRenderer->Render();
-    }
-#endif
-
     GLenum attachments[] = { GL_DEPTH, GL_STENCIL };
     mImpl->context.InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
 
index 41553eb..4c7e357 100644 (file)
@@ -45,7 +45,6 @@ namespace SceneGraph
 {
 class Renderer;
 class RenderQueue;
-class DynamicsDebugRenderer;
 class RenderMaterial;
 class TextureCache;
 class RenderInstruction;
@@ -128,14 +127,6 @@ public:
    */
   void SetFrameDeltaTime( float deltaTime );
 
-#ifdef DYNAMICS_SUPPORT
-  /**
-   * create a dynamics debug renderer
-   * @param[in] debugRenderer The dynamics world debug renderer
-   */
-  void InitializeDynamicsDebugRenderer(DynamicsDebugRenderer* debugRenderer);
-#endif
-
   /**
    * Returns the rectangle for the default surface (probably the application window).
    * @return Rectangle for the surface.
diff --git a/dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.cpp b/dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.cpp
deleted file mode 100644 (file)
index 6a86e7b..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include "scene-graph-dynamics-debug-renderer.h"
-
-// INTERNAL HEADERS
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/gl-resources/context.h>
-#include <dali/internal/render/shaders/program.h>
-#include <dali/internal/render/shaders/shader.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace SceneGraph
-{
-
-DynamicsDebugRenderer::DynamicsDebugRenderer(const Shader& debugShader)
-: mShader(const_cast<Shader&>(debugShader)),
-  mContext(NULL),
-  mBufferIndex(0),
-  mViewMatrix(Matrix::IDENTITY),
-  mProjectionMatrix(Matrix::IDENTITY),
-  mNumberOfPoints(0)
-{
-  DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
-}
-
-DynamicsDebugRenderer::~DynamicsDebugRenderer()
-{
-}
-
-void DynamicsDebugRenderer::Initialize(Context& context)
-{
-  DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
-
-  mContext = &context;
-}
-
-void DynamicsDebugRenderer::UpdateMatrices( BufferIndex bufferIndex, const Matrix& projectionMatrix, const Matrix& viewMatrix )
-{
-  mProjectionMatrix = projectionMatrix;
-  mViewMatrix = viewMatrix;
-  mBufferIndex = bufferIndex;
-}
-
-void DynamicsDebugRenderer::UpdateBuffer( const Integration::DynamicsDebugVertexContainer& vertices )
-{
-  if( NULL != mContext )
-  {
-    if( !mBuffer )
-    {
-      mBuffer = new GpuBuffer(*mContext, GpuBuffer::ARRAY_BUFFER, GpuBuffer::STATIC_DRAW);
-    }
-
-    if( vertices.size() > 1 )
-    {
-      mBuffer->UpdateDataBuffer( vertices.size() * sizeof(vertices[0]), vertices.data() );
-    }
-    mNumberOfPoints = vertices.size();
-  }
-}
-
-void DynamicsDebugRenderer::Render()
-{
-  // @todo reimplement this properly in future
-}
-
-
-} // namespace SceneGraph
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.h b/dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.h
deleted file mode 100644 (file)
index 9618aa0..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef __SCENE_GRAPH_DYNAMICS_DEBUG_RENDERER_H__
-#define __SCENE_GRAPH_DYNAMICS_DEBUG_RENDERER_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL HEADERS
-#include <dali/internal/common/buffer-index.h>
-#include <dali/internal/common/message.h>
-#include <dali/internal/common/owner-pointer.h>
-#include <dali/internal/render/gl-resources/gpu-buffer.h>
-#include <dali/integration-api/dynamics/dynamics-debug-vertex.h>
-#include <dali/public-api/math/vector3.h>
-#include <dali/public-api/math/vector4.h>
-#include <dali/public-api/math/matrix.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class Context;
-
-namespace SceneGraph
-{
-
-class Shader;
-
-/**
- * Dynamics world debug renderer
- * Renderers an array of colored line sections
- */
-class DynamicsDebugRenderer
-{
-public:
-
-  DynamicsDebugRenderer(const Shader& debugShader);
-  virtual ~DynamicsDebugRenderer();
-
-  void Initialize(Context& context);
-  void Render();
-  void UpdateMatrices( BufferIndex bufferIndex, const Matrix& projectionMatrix, const Matrix& viewMatrix );
-  void UpdateBuffer( const Integration::DynamicsDebugVertexContainer& vertices );
-
-private:
-  Shader& mShader;
-  Context* mContext;
-  BufferIndex mBufferIndex;
-  Matrix mViewMatrix;
-  Matrix mProjectionMatrix;
-  OwnerPointer<GpuBuffer> mBuffer;
-  int mNumberOfPoints;
-};
-
-} // namespace SceneGraph
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif /* __SCENE_GRAPH_DYNAMICS_DEBUG_RENDERER_H__ */
diff --git a/dali/internal/update/dynamics/scene-graph-dynamics-world-debug.cpp b/dali/internal/update/dynamics/scene-graph-dynamics-world-debug.cpp
deleted file mode 100644 (file)
index 3633578..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include "scene-graph-dynamics-world-debug.h"
-
-// INTERNAL HEADERS
-#include <dali/integration-api/debug.h>
-#include <dali/internal/render/queue/render-queue.h>
-#include <dali/internal/update/controllers/scene-controller.h>
-#include <dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.h>
-#include <dali/internal/render/shaders/shader.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace SceneGraph
-{
-
-DynamicsWorldDebug::DynamicsWorldDebug(SceneController& sceneController, const Shader& debugShader)
-: mDebugMode(0),//(btIDebugDraw::DBG_DrawWireframe),//(0),
-  mSceneController(sceneController)
-{
-  DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
-  mRenderer = new DynamicsDebugRenderer( debugShader );
-}
-
-DynamicsWorldDebug::~DynamicsWorldDebug()
-{
-  // TODO Auto-generated destructor stub
-}
-
-//void DynamicsWorldDebug::drawLine(const btVector3& from,const btVector3& to,const btVector3& color)
-//{
-////  DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
-//
-//  DynamicsDebugVertex vertex;
-//  vertex.position = Vector3( from.getX(), from.getY(), from.getZ() );
-//  vertex.color = Vector4( color.getX(), color.getY(), color.getZ(), 1.0f );
-//  mVertices.push_back( vertex );
-//  vertex.position = Vector3( to.getX(), to.getY(), to.getZ());
-//  mVertices.push_back( vertex );
-//}
-//
-//void DynamicsWorldDebug::drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color)
-//{
-//  btVector3 to = PointOnB + (normalOnB * distance);// * 10.0f;
-//
-//  drawLine(PointOnB, to, color);
-//}
-//
-//void DynamicsWorldDebug::reportErrorWarning(const char* warningString)
-//{
-//  DALI_LOG_ERROR( "Dynamics error: %s\n", warningString );
-//}
-//
-//void DynamicsWorldDebug::draw3dText(const btVector3& location,const char* textString)
-//{
-//}
-
-void DynamicsWorldDebug::setDebugMode(int debugMode)
-{
-  mDebugMode = debugMode;
-}
-
-int DynamicsWorldDebug::getDebugMode() const
-{
-  return mDebugMode;
-}
-
-void DynamicsWorldDebug::UpdateMatrices(BufferIndex bufferIndex, const Matrix& projectionMatrix, const Matrix& viewMatrix)
-{
-  mSceneController.GetRenderQueue().QueueMessage(bufferIndex, UpdateMatricesMessage(GetRenderer(), bufferIndex, projectionMatrix, viewMatrix) );
-}
-
-void DynamicsWorldDebug::StartFrame()
-{
-  mVertices.clear();
-}
-
-void DynamicsWorldDebug::EndFrame(BufferIndex bufferIndex)
-{
-  mSceneController.GetRenderQueue().QueueMessage(bufferIndex, UpdateVerticesMessage(GetRenderer(), mVertices) );
-}
-
-
-const DynamicsDebugVertexContainer& DynamicsWorldDebug::GetVertices() const
-{
-  return mVertices;
-}
-
-DynamicsDebugRenderer& DynamicsWorldDebug::GetRenderer() const
-{
-  return *mRenderer;
-}
-
-} // namespace SceneGraph
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/update/dynamics/scene-graph-dynamics-world-debug.h b/dali/internal/update/dynamics/scene-graph-dynamics-world-debug.h
deleted file mode 100644 (file)
index 14d8f34..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef __SCENE_GRAPH_DYNAMICS_WORLD_DEBUG_H__
-#define __SCENE_GRAPH_DYNAMICS_WORLD_DEBUG_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-// INTERNAL HEADERS
-#include <dali/internal/update/dynamics/scene-graph-dynamics-debug-vertex.h>
-
-namespace Dali
-{
-
-class Matrix;
-
-namespace Internal
-{
-
-namespace SceneGraph
-{
-
-class DynamicsDebugRenderer;
-class SceneController;
-class Shader;
-
-/**
- * Debug draw class, Physics engine will invoke methods on this object to render debug information
- */
-class DynamicsWorldDebug// : public btIDebugDraw
-{
-public:
-  /**
-   * @param[in] sceneController Allows access to render manager message queue
-   */
-  DynamicsWorldDebug(SceneController& sceneController, const Shader& debugShader );
-  virtual ~DynamicsWorldDebug();
-
-//  virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color);
-//  virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color);
-//  virtual void reportErrorWarning(const char* warningString);
-//  virtual void draw3dText(const btVector3& location,const char* textString);
-  virtual void setDebugMode(int debugMode);
-  virtual int  getDebugMode() const;
-
-  void UpdateMatrices(BufferIndex bufferIndex, const Matrix& projectionMatrix, const Matrix& viewMatrix);
-  void StartFrame();
-  void EndFrame(BufferIndex bufferIndex);
-  const DynamicsDebugVertexContainer& GetVertices() const;
-  DynamicsDebugRenderer& GetRenderer() const;
-private:
-  int                          mDebugMode;
-  SceneController&             mSceneController;
-  DynamicsDebugRenderer*       mRenderer;
-  DynamicsDebugVertexContainer mVertices;
-}; // class DynamicsWorldDebug
-
-} // namespace SceneGraph
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif /* __SCENE_GRAPH_DYNAMICS_WORLD_DEBUG_H__ */
index 0ae027a..2b237d2 100644 (file)
@@ -32,7 +32,6 @@
 #include <dali/internal/event/dynamics/dynamics-body-config-impl.h>
 #include <dali/internal/event/dynamics/dynamics-world-config-impl.h>
 #include <dali/internal/render/queue/render-queue.h>
-#include <dali/internal/render/dynamics/scene-graph-dynamics-debug-renderer.h>
 #include <dali/internal/update/controllers/scene-controller.h>
 #include <dali/internal/update/dynamics/scene-graph-dynamics-body.h>
 #include <dali/internal/update/dynamics/scene-graph-dynamics-joint.h>
@@ -51,7 +50,6 @@ DynamicsWorld::DynamicsWorld(DynamicsNotifier& dynamicsNotifier,
                              Integration::DynamicsFactory& dynamicsFactory )
 : mDynamicsNotifier(dynamicsNotifier),
   mNotificationManager(notificationManager),
-  mRenderer(NULL),
   mSceneController(NULL),
   mBuffers(NULL),
   mDynamicsFactory(dynamicsFactory),
@@ -105,7 +103,7 @@ DynamicsWorld::~DynamicsWorld()
   mDynamicsFactory.TerminateDynamics();
 }
 
-void DynamicsWorld::Initialize(SceneController* sceneController, Integration::DynamicsWorldSettings* worldSettings, const Shader* debugShader, const SceneGraphBuffers* buffers )
+void DynamicsWorld::Initialize(SceneController* sceneController, Integration::DynamicsWorldSettings* worldSettings, const SceneGraphBuffers* buffers )
 {
   DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::General, "%s\n", __PRETTY_FUNCTION__);
 
@@ -116,8 +114,6 @@ void DynamicsWorld::Initialize(SceneController* sceneController, Integration::Dy
 
   mSceneController = sceneController;
   mBuffers = buffers;
-
-  mRenderer = new DynamicsDebugRenderer( *debugShader );
 }
 
 void DynamicsWorld::AddBody(DynamicsBody& body)
@@ -264,11 +260,6 @@ void DynamicsWorld::SetGravity( const Vector3& gravity )
   mDynamicsWorld->SetGravity( gravity );
 }
 
-void DynamicsWorld::SetDebugDrawMode(const int mode)
-{
-  mDynamicsWorld->SetDebugDrawMode( mode );
-}
-
 BufferIndex DynamicsWorld::GetBufferIndex() const
 {
   return mBuffers->GetUpdateBufferIndex();
@@ -284,7 +275,7 @@ Integration::DynamicsWorld& DynamicsWorld::GetDynamicsWorld()
   return *mDynamicsWorld;
 }
 
-bool DynamicsWorld::Update( const float elapsedSeconds )
+bool DynamicsWorld::Update( float elapsedSeconds )
 {
   bool anyPositionChanged( false );
 
@@ -298,7 +289,6 @@ bool DynamicsWorld::Update( const float elapsedSeconds )
 
     if( anyPositionChanged )
     {
-      DebugDraw();
       CheckForCollisions();
     }
   }
@@ -419,49 +409,6 @@ float DynamicsWorld::GetWorldScale() const
   return 1.0f / mSettings->worldScale;
 }
 
-void DynamicsWorld::DebugDraw()
-{
-  // Send request to the simulation to render selected debug information
-  typedef MessageValue1< DynamicsDebugRenderer, Integration::DynamicsDebugVertexContainer > DerivedType;
-
-  // Reserve some memory inside the render queue
-  unsigned int* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( GetBufferIndex(), sizeof( DerivedType ) );
-
-  // Construct message in the render queue memory; note that delete should not be called on the return value
-  new (slot) DerivedType( &GetDebugRenderer(), &DynamicsDebugRenderer::UpdateBuffer, mDynamicsWorld->DebugDraw() );
-}
-
-void DynamicsWorld::UpdateMatrices( const Matrix& projectionMatrix, const Matrix& viewMatrix)
-{
-  typedef MessageDoubleBuffered2< DynamicsDebugRenderer, Matrix, Matrix > DerivedType;
-
-  // Reserve some memory inside the render queue
-  unsigned int* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( GetBufferIndex(), sizeof( DerivedType ) );
-
-  if( mNode )
-  {
-    Matrix modelView(false);
-    Matrix::Multiply(modelView, mNode->GetWorldMatrix( GetBufferIndex() ), viewMatrix);
-    const float scale(GetWorldScale());
-    modelView.SetXAxis(modelView.GetXAxis()*scale);
-    modelView.SetYAxis(modelView.GetYAxis()*scale);
-    modelView.SetZAxis(modelView.GetZAxis()*scale);
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( mRenderer, &DynamicsDebugRenderer::UpdateMatrices, projectionMatrix, modelView );
-  }
-  else
-  {
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( mRenderer, &DynamicsDebugRenderer::UpdateMatrices, projectionMatrix, viewMatrix );
-  }
-}
-
-DynamicsDebugRenderer& DynamicsWorld::GetDebugRenderer() const
-{
-  return *mRenderer;
-}
-
 } // namespace SceneGraph
 
 } // namespace Internal
index 1829691..53ef8d3 100644 (file)
@@ -37,7 +37,6 @@ namespace Integration
 {
 
 struct DynamicsCollisionData;
-class  DynamicsDebugRenderer;
 class  DynamicsFactory;
 class  DynamicsWorld;
 struct DynamicsWorldSettings;
@@ -61,8 +60,6 @@ struct DynamicsCollisionData;
 class DynamicsBody;
 class DynamicsJoint;
 class DynamicsShape;
-class DynamicsWorldDebug;
-class DynamicsDebugRenderer;
 class SceneController;
 
 class DynamicsWorld
@@ -89,7 +86,7 @@ public:
    * @param[in] sceneController Allows access to the render message queue
    * @param[in] worldSettings   The configuration for the new DynamicsWorld
    */
-  void Initialize(SceneController* sceneController, Integration::DynamicsWorldSettings* worldSettings, const Shader* debugShader, const SceneGraphBuffers* buffers);
+  void Initialize(SceneController* sceneController, Integration::DynamicsWorldSettings* worldSettings, const SceneGraphBuffers* buffers);
 
   void AddBody(DynamicsBody& body);
   void RemoveBody(DynamicsBody& body);
@@ -105,15 +102,12 @@ public:
   /// @copydoc Dali::DynamicsWorld::SetGravity
   void SetGravity( const Vector3& gravity );
 
-  /// @copydoc Dali::DynamicsWorld::SetDebugDrawMode
-  void SetDebugDrawMode( int mode );
-
   /**
    * Step the simulation and check for collisions
    * @param[in] elapsedSeconds Time in seconds since last invocation
    * @return true if any body was translated or rotated
    */
-  bool Update( const float elapsedSeconds );
+  bool Update( float elapsedSeconds );
 
   /**
    * Update the simulation positions from the corresponding node position
@@ -127,11 +121,6 @@ public:
   bool PostSimulationStep();
 
   /**
-   * Allow dynamics engine to do its debug drawing
-   */
-  void DebugDraw();
-
-  /**
    * Check for collisions between simulation objects
    */
   void CheckForCollisions();
@@ -172,14 +161,6 @@ public:
    */
   Integration::DynamicsWorld& GetDynamicsWorld();
 
-public: // debug drawing
-
-  // Send projection and view matrices to the debug renderer
-  void UpdateMatrices( const Matrix& projectionMatrix, const Matrix& viewMatrix );
-
-  // Get the debug renderer
-  DynamicsDebugRenderer& GetDebugRenderer() const;
-
 private:
 
   // unimplemented copy constructor and assignment operator
@@ -207,7 +188,6 @@ private:
   NotificationManager&      mNotificationManager;
 
   Node*                     mNode;
-  DynamicsDebugRenderer*    mRenderer;
   SceneController*          mSceneController;
   const SceneGraphBuffers*  mBuffers;
 
@@ -231,17 +211,6 @@ inline void SetGravityMessage( EventToUpdate& eventToUpdate, const DynamicsWorld
   new (slot) LocalType( &world, &DynamicsWorld::SetGravity, gravity );
 }
 
-inline void SetDebugDrawModeMessage( EventToUpdate& eventToUpdate, const DynamicsWorld& world, int mode )
-{
-  typedef MessageValue1< DynamicsWorld, int > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &world, &DynamicsWorld::SetDebugDrawMode, mode );
-}
-
 inline void SetRootActorMessage( EventToUpdate& eventToUpdate, const DynamicsWorld& world, const Node* node )
 {
   typedef MessageValue1< DynamicsWorld, Node* > LocalType;
index 0a94ddf..ce1f435 100644 (file)
@@ -1120,20 +1120,6 @@ unsigned int UpdateManager::Update( float elapsedSeconds, unsigned int lastVSync
                              mImpl->renderSortingHelper,
                              mImpl->renderInstructions );
       }
-
-#ifdef DYNAMICS_SUPPORT
-      // if dynamics enabled and active...update matrices for debug drawing
-      if( mImpl->dynamicsWorld && mImpl->dynamicsChanged )
-      {
-        RenderTask* task(mImpl->taskList.GetTasks()[0]);
-        if( task )
-        {
-          mImpl->dynamicsWorld->UpdateMatrices( task->GetProjectionMatrix(mSceneGraphBuffers.GetUpdateBufferIndex()),
-                                                task->GetViewMatrix(mSceneGraphBuffers.GetUpdateBufferIndex()) );
-        }
-      }
-#endif // DYNAMICS_SUPPORT
-
     }
   }
 
@@ -1278,18 +1264,10 @@ void UpdateManager::SetLayerDepths( const SortedLayerPointers& layers, bool syst
 
 #ifdef DYNAMICS_SUPPORT
 
-void UpdateManager::InitializeDynamicsWorld( SceneGraph::DynamicsWorld* dynamicsWorld, Integration::DynamicsWorldSettings* worldSettings, SceneGraph::Shader* debugShader )
+void UpdateManager::InitializeDynamicsWorld( SceneGraph::DynamicsWorld* dynamicsWorld, Integration::DynamicsWorldSettings* worldSettings )
 {
-  dynamicsWorld->Initialize( mImpl->sceneController, worldSettings, debugShader, &mSceneGraphBuffers );
+  dynamicsWorld->Initialize( mImpl->sceneController, worldSettings, &mSceneGraphBuffers );
   mImpl->dynamicsWorld = dynamicsWorld;
-
-  typedef MessageValue1< RenderManager, DynamicsDebugRenderer* > DerivedType;
-
-  // Reserve some memory inside the render queue
-  unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-  // Construct message in the render queue memory; note that delete should not be called on the return value
-  new (slot) DerivedType( &mImpl->renderManager, &RenderManager::InitializeDynamicsDebugRenderer, &dynamicsWorld->GetDebugRenderer() );
 }
 
 void UpdateManager::TerminateDynamicsWorld()
index ecd97c1..8e64e15 100644 (file)
@@ -394,7 +394,7 @@ public:
    * @param[in] worldSettings The dynamics world settings
    * @param[in] debugShader The shader used for rendering dynamics debug information
    */
-  void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings, Shader* debugShader );
+  void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings );
 
   /**
    * Terminate the dynamics world
@@ -850,15 +850,15 @@ inline void RemoveGestureMessage( UpdateManager& manager, PanGesture* gesture )
 #ifdef DYNAMICS_SUPPORT
 
 // Dynamics messages
-inline void InitializeDynamicsWorldMessage(UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings, const Shader* debugShader)
+inline void InitializeDynamicsWorldMessage( UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings )
 {
-  typedef MessageValue3< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings*, Shader*> LocalType;
+  typedef MessageValue2< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings* > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::InitializeDynamicsWorld, dynamicsworld, worldSettings, const_cast<Shader*>(debugShader) );
+  new (slot) LocalType( &manager, &UpdateManager::InitializeDynamicsWorld, dynamicsworld, worldSettings );
 }
 
 inline void TerminateDynamicsWorldMessage(UpdateManager& manager)