查到这个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. MovablePlane issue
oiram
Newcomer
 
Posts: 14
Joined: Sun Dec 13, 2009 4:06 am

相关文章:

  • 2021-11-10
  • 2021-09-24
  • 2022-01-01
  • 2021-11-09
  • 2021-08-25
  • 2021-07-18
  • 2021-11-10
  • 2021-11-26
猜你喜欢
  • 2021-08-30
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案