Google

MovablePlane issue

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.

Moderators: Moderators, OGRE Team

MovablePlane issue

Postby oiram » Wed Feb 03, 2010 5:10 am

This issue is about member function getBoundingRadius of MovablePlane.

Code: Select all
MovablePlane.h
        // Overridden from MovableObject
        const AxisAlignedBox& getBoundingBox(void) const { return mNullBB; }
        /// Overridden from MovableObject
        Real getBoundingRadius(void) const { return Math::POS_INFINITY; }


I'm sad with bounding box is null box but bounding radius is infinity.
on this case, when create a moveable plane in an app, scene_depth_range and shadow_scene_depth_range will be corrupted.

Code: Select all
OgreSceneManager.cpp
void SceneManager::_renderScene(Camera* camera, Viewport* vp, bool includeOverlays)
{
......
      if (mFindVisibleObjects)
      {
         OgreProfileGroup("_findVisibleObjects", OGREPROF_CULLING);

         // Assemble an AAB on the fly which contains the scene elements visible
         // by the camera.
         CamVisibleObjectsMap::iterator camVisObjIt = mCamVisibleObjectsMap.find( camera );

         assert (camVisObjIt != mCamVisibleObjectsMap.end() &&
            "Should never fail to find a visible object bound for a camera, "
            "did you override SceneManager::createCamera or something?");

         // reset the bounds
         camVisObjIt->second.reset();

         // Parse the scene and tag visibles
         firePreFindVisibleObjects(vp);
         _findVisibleObjects(camera, &(camVisObjIt->second),
            mIlluminationStage == IRS_RENDER_TO_TEXTURE? true : false);
         firePostFindVisibleObjects(vp);

         mAutoParamDataSource->setMainCamBoundsInfo(&(camVisObjIt->second));
      }

_findVisibleObjects(camera, &(camVisObjIt->second),
mIlluminationStage == IRS_RENDER_TO_TEXTURE? true : false);

mAutoParamDataSource->setMainCamBoundsInfo(&(camVisObjIt->second));
See bold text above, that moveable plane corrupted auto param.

My solution is here:
Code: Select all
MovablePlane.h
        // Overridden from MovableObject
        const AxisAlignedBox& getBoundingBox(void) const { return mNullBB; }
        /// Overridden from MovableObject
        Real getBoundingRadius(void) const { return 0.0f /*Math::POS_INFINITY*/; }


thanks for any reply. :)
oiram
Newcomer
 
Posts: 18
Joined: Sun Dec 13, 2009 5:06 am

Re: MovablePlane issue

Postby sinbad » Wed Feb 03, 2010 5:27 pm

Yes, you're right - in future, you can just submit these kinds of things as a patch, but I've changed this. Thanks for the thorough report!
User avatar
sinbad
OGRE Founder, Ex-Lead
OGRE Founder, Ex-Lead
 
Posts: 25646
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands

Re: MovablePlane issue

Postby oiram » Thu Feb 04, 2010 3:45 pm

thanks~ :)
oiram
Newcomer
 
Posts: 18
Joined: Sun Dec 13, 2009 5:06 am


Return to Developer talk

Who is online

Users browsing this forum: MSN [Bot] and 1 guest