Hi Vincent,

> Do you mean that I have to initialize the Bounding Sphere of the PagedLOD
> node when I create it ? because I didn't found any special method in LOD or
> PagedLOD about that.

You obviously didn't look hard enough...  in the LOD header you'll find:

        /** Modes which control how the center of object should be
determined when computing which child is active.*/
        enum CenterMode
        {
            USE_BOUNDING_SPHERE_CENTER,
            USER_DEFINED_CENTER
        };

        /** Set how the center of object should be determined when
computing which child is active.*/
        void setCenterMode(CenterMode mode) { _centerMode=mode; }

        /** Get how the center of object should be determined when
computing which child is active.*/
        CenterMode getCenterMode() const { return _centerMode; }

        /** Sets the object-space point which defines the center of
the osg::LOD.
            center is affected by any transforms in the hierarchy
above the osg::LOD.*/
        inline void setCenter(const vec_type& center) {
_centerMode=USER_DEFINED_CENTER; _userDefinedCenter = center; }

        /** return the LOD center point. */
        inline const vec_type& getCenter() const { if
(_centerMode==USER_DEFINED_CENTER) return _userDefinedCenter; else
return getBound().center(); }


        /** Set the object-space reference radius of the volume
enclosed by the LOD.
          * Used to determine the bounding sphere of the LOD in the
absence of any children.*/
        inline void setRadius(value_type radius) { _radius = radius; }

        /** Get the object-space radius of the volume enclosed by the LOD.*/
        inline value_type getRadius() const { return _radius; }


Use these user bounding sphere methods when your PagedLOD has all
external children to make sure it has a relevant bounding sphere.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to