|
osg::ref_ptr<osg::Node> createOccluder(const osg::Vec3& v1,const osg::Vec3& v2,const osg::Vec3& v3,const osg::Vec3& v4)
{
osg::ref_ptr<osg::OccluderNode> occludernode = new osg::OccluderNode();
//创建遮挡平面
osg::ref_ptr<osg::ConvexPlanarOccluder> cpo = new osg::ConvexPlanarOccluder;
//遮挡节点关联遮挡平面
occludernode->setOccluder(cpo);
occludernode->setName("occluder");
//初始化一个遮挡平面
osg::ConvexPlanarPolygon& occluder = cpo->getOccluder();
occluder.add(v1);
occluder.add(v2);
occluder.add(v3);
occluder.add(v4);
//为遮挡面画一四边形
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
osg::Vec3Array* coords = new osg::Vec3Array(occluder.);
我想问下我的代码有问题吗?为什么occluder.弹出来提示,头文件也都加上了,我找了半天没找出,好心人帮我看看,前面的occluder.add(v1)还能弹出来,谢谢 |
|