1 #ifndef ClothDrawable_h
2 #define ClothDrawable_h
5 #include <osg/Drawable>
10 #include <cloth/NxCloth.h>
13 using namespace vrecko;
30 void PCloth(NxCloth* val) { _pCloth = val; }
40 this->setSupportsDisplayList(
false);
45 glEnableClientState(GL_VERTEX_ARRAY);
46 glEnableClientState(GL_NORMAL_ARRAY);
48 _meshData = _pCloth->getMeshData();
49 this->setSupportsDisplayList(
false);
57 Drawable(drawable,copyop)
62 virtual osg::Object*
clone(
const osg::CopyOp& copyop)
const {
return new ClothDrawable(*
this,copyop); }
66 virtual void drawImplementation(osg::RenderInfo& renderInfo)
const
69 glVertexPointer(3, GL_FLOAT, 0, _meshData.verticesPosBegin);
70 glNormalPointer(GL_FLOAT, 0, _meshData.verticesNormalBegin);
72 glDrawElements(GL_TRIANGLES, *_meshData.numIndicesPtr, GL_UNSIGNED_INT, _meshData.indicesBegin);
86 virtual const char*
className()
const {
return "ClothDrawable";}
90 virtual osg::BoundingBox computeBound()
const
93 _pCloth->getWorldBounds(Nxbbox);
95 osg::BoundingBox bbox;