Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10195 for code


Ignore:
Timestamp:
Jan 13, 2015, 10:54:15 PM (10 years ago)
Author:
landauf
Message:

removed unnecessary material from BulletDebugDrawer.
fixed crash with ogre 1.7 if the number of vertices dropped to 0 in DebugDrawer.

Location:
code/trunk/src/libraries/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/tools/BulletDebugDrawer.cc

    r10193 r10195  
    1111#include <OgreRoot.h>
    1212#include <OgreManualObject.h>
    13 #include <OgreMaterialManager.h>
    1413#include <OgreSceneManager.h>
    1514
     
    2524
    2625        mContactPoints = &mContactPoints1;
    27 
    28         static const char* matName = "OgreBulletCollisionsDebugDefault";
    29         Ogre::MaterialPtr mtl = Ogre::MaterialManager::getSingleton().getDefaultSettings()->clone(matName);
    30         mtl->setReceiveShadows(false);
    31         mtl->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
    32         mtl->setDepthBias(0.1, 0);
    33         Ogre::TextureUnitState* tu = mtl->getTechnique(0)->getPass(0)->createTextureUnitState();
    34         tu->setColourOperationEx(Ogre::LBX_SOURCE1, Ogre::LBS_DIFFUSE);
    35         mtl->getTechnique(0)->setLightingEnabled(false);
    36         //mtl->getTechnique(0)->setSelfIllumination(Ogre::ColourValue::White);
    3726
    3827        mDebugMode = (DebugDrawModes) DBG_DrawWireframe;
     
    135124        // Right before the frame is rendered, call DebugDrawer::build().
    136125        this->drawer_->build();
     126
    137127        return true;
    138128    }
     
    142132        // After the frame is rendered, call DebugDrawer::clear()
    143133        this->drawer_->clear();
     134
    144135        return true;
    145136    }
  • code/trunk/src/libraries/tools/DebugDrawer.cc

    r10194 r10195  
    1515#include <OgreManualObject.h>
    1616#include <OgreAxisAlignedBox.h>
    17 
    18 #include "util/Output.h"
    1917
    2018#define DEFAULT_ICOSPHERE_RECURSION_LEVEL 1
     
    402400                manualObject->index(*i);
    403401        }
     402        else
     403            manualObject->index(0); // this is necessary to avoid crashes with ogre 1.7 if there's a light source in the level
    404404        manualObject->end();
    405405
     
    417417                manualObject->index(*i);
    418418        }
     419        else
     420            manualObject->index(0); // this is necessary to avoid crashes with ogre 1.7 if there's a light source in the level
    419421        manualObject->end();
    420422    }
Note: See TracChangeset for help on using the changeset viewer.