zoukankan      html  css  js  c++  java
  • 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!

  • 相关阅读:
    好久没锻炼
    liunx下安装第三方Python(PIP安装)
    Mysql和SqlServer互相转换
    sqlmap使用笔记
    查找域控的几个常用方法
    ssh的一些小操作
    使用theHarvester 进行邮箱和子域名的收集
    python实现大文件分割与合并
    python中MySQLdb模块用法实例
    2. Shell编程第二讲
  • 原文地址:https://www.cnblogs.com/oiramario/p/1663843.html
Copyright © 2011-2022 走看看