MovablePlane issue

查到这个bug是因为前段时间实现vsm时,需要用到scene_depth_range 和 shadow_scene_depth_range,而我的模型查看器的地表是创建的一个plane,于是查到有些问题。

这两天想起来发到论坛里找sinbad验证一下,于是乎~ 

 

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: 14
Joined: Sun Dec 13, 2009 4:06 am

Re: MovablePlane issue

Postby sinbad » Wed Feb 03, 2010 4: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!

posted @ 2010-02-04 17:33  千里马肝  阅读(756)  评论(0编辑  收藏  举报