[Orxonox-commit 5532] r10195 - code/trunk/src/libraries/tools

landauf at orxonox.net landauf at orxonox.net
Tue Jan 13 22:54:15 CET 2015


Author: landauf
Date: 2015-01-13 22:54:15 +0100 (Tue, 13 Jan 2015)
New Revision: 10195

Modified:
   code/trunk/src/libraries/tools/BulletDebugDrawer.cc
   code/trunk/src/libraries/tools/DebugDrawer.cc
Log:
removed unnecessary material from BulletDebugDrawer.
fixed crash with ogre 1.7 if the number of vertices dropped to 0 in DebugDrawer.

Modified: code/trunk/src/libraries/tools/BulletDebugDrawer.cc
===================================================================
--- code/trunk/src/libraries/tools/BulletDebugDrawer.cc	2015-01-13 20:59:01 UTC (rev 10194)
+++ code/trunk/src/libraries/tools/BulletDebugDrawer.cc	2015-01-13 21:54:15 UTC (rev 10195)
@@ -10,7 +10,6 @@
 
 #include <OgreRoot.h>
 #include <OgreManualObject.h>
-#include <OgreMaterialManager.h>
 #include <OgreSceneManager.h>
 
 #include "util/Output.h"
@@ -25,16 +24,6 @@
 
         mContactPoints = &mContactPoints1;
 
-        static const char* matName = "OgreBulletCollisionsDebugDefault";
-        Ogre::MaterialPtr mtl = Ogre::MaterialManager::getSingleton().getDefaultSettings()->clone(matName);
-        mtl->setReceiveShadows(false);
-        mtl->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
-        mtl->setDepthBias(0.1, 0);
-        Ogre::TextureUnitState* tu = mtl->getTechnique(0)->getPass(0)->createTextureUnitState();
-        tu->setColourOperationEx(Ogre::LBX_SOURCE1, Ogre::LBS_DIFFUSE);
-        mtl->getTechnique(0)->setLightingEnabled(false);
-        //mtl->getTechnique(0)->setSelfIllumination(Ogre::ColourValue::White);
-
         mDebugMode = (DebugDrawModes) DBG_DrawWireframe;
         Ogre::Root::getSingleton().addFrameListener(this);
     }
@@ -134,6 +123,7 @@
 
         // Right before the frame is rendered, call DebugDrawer::build().
         this->drawer_->build();
+
         return true;
     }
 
@@ -141,6 +131,7 @@
     {
         // After the frame is rendered, call DebugDrawer::clear()
         this->drawer_->clear();
+
         return true;
     }
 

Modified: code/trunk/src/libraries/tools/DebugDrawer.cc
===================================================================
--- code/trunk/src/libraries/tools/DebugDrawer.cc	2015-01-13 20:59:01 UTC (rev 10194)
+++ code/trunk/src/libraries/tools/DebugDrawer.cc	2015-01-13 21:54:15 UTC (rev 10195)
@@ -15,8 +15,6 @@
 #include <OgreManualObject.h>
 #include <OgreAxisAlignedBox.h>
 
-#include "util/Output.h"
-
 #define DEFAULT_ICOSPHERE_RECURSION_LEVEL 1
 
 namespace orxonox
@@ -401,6 +399,8 @@
             for (std::list<int>::iterator i = lineIndices.begin(); i != lineIndices.end(); i++)
                 manualObject->index(*i);
         }
+        else
+            manualObject->index(0); // this is necessary to avoid crashes with ogre 1.7 if there's a light source in the level
         manualObject->end();
 
         manualObject->beginUpdate(1);
@@ -416,6 +416,8 @@
             for (std::list<int>::iterator i = triangleIndices.begin(); i != triangleIndices.end(); i++)
                 manualObject->index(*i);
         }
+        else
+            manualObject->index(0); // this is necessary to avoid crashes with ogre 1.7 if there's a light source in the level
         manualObject->end();
     }
 




More information about the Orxonox-commit mailing list