osg.TriangleLinePointIndexFunctor
是一个模板类,它是osg::Drawable::DrawCallback
层次结构中的一个特殊绘制回调。
它的主要作用是:根据三角形组成的面绘制线框图。它将线框图渲染在已有的渲染上下文中,并根据需要创建和安装新的状态集合。
osg::Referenced
osg::Object
osg::Callback
osg::Drawable::DrawCallback
osg::TriangleLinePointIndexFunctor
TriangleLinePointIndexFunctor();
TriangleLinePointIndexFunctor(const osg::TriangleIndexFunctor<osg::DrawElementsUInt>& tif);
TriangleLinePointIndexFunctor(const osg::TriangleLinePointIndexFunctor& tif, osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY);
void operator ()(const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3, bool treatVertexDataAsTemporary);
void operator ()(const osg::Vec3& v1, unsigned int index1, const osg::Vec3& v2, unsigned int index2, const osg::Vec3& v3, unsigned int index3, bool treatVertexDataAsTemporary);
void operator ()(const osg::Vec3& v1, unsigned int /*index1*/, bool treatVertexDataAsTemporary);
void operator ()(const osg::Vec3& v1, const osg::Vec3& v2, unsigned int /*index*/, bool treatVertexDataAsTemporary);
void setTessellationIterations(unsigned int iterations);
unsigned int getTessellationIterations() const;
void setTessellationOriginAndDistance(const osg::Vec3& origin, float distance);
osg::Vec3 getTessellationOrigin() const;
float getTessellationDistance() const;
void setColor(const osg::Vec4& color);
void setLineWidth(float width);
v1
, v2
, v3
: 顶点信息index1
, index2
, index3
: 顶点索引信息treatVertexDataAsTemporary
: 是否将顶点数据视为临时数据iterations
: 细分迭代次数origin
: 细分起点坐标distance
: 细分距离color
: 线框颜色width
: 线框宽度osg::ref_ptr<osg::TriangleLinePointIndexFunctor> callback = new osg::TriangleLinePointIndexFunctor();
myDrawable->setDrawCallback(callback.get());