osgAnimation.RigComputeBoundingBoxCallback类定义了一种计算关节动画包围盒的回调方法,该类继承自osg::Callback
类。
RigComputeBoundingBoxCallback()
osg::BoundingBox& getBoundingBox()
const osg::BoundingBox& getBoundingBox() const
virtual bool run(osg::Object* object, osg::Object* data)
// 构建包围盒回调
osg::ref_ptr<osgAnimation::RigComputeBoundingBoxCallback> bboxCallback = new osgAnimation::RigComputeBoundingBoxCallback();
// 初始化动画节点,将包围盒回调加入节点
osg::ref_ptr<osgAnimation::Bone> bone = new osgAnimation::Bone();
bone->addUpdateCallback(bboxCallback);
// 计算包围盒
osg::BoundingBox bbox = bboxCallback->getBoundingBox();