void PRCExporter::analyseGeode ( osg::Geode *geode, oPRCFile *out ) { getCurrentMaterial ( geode ); for ( unsigned int i=0; i<geode->getNumDrawables(); i++ ) { osg::Drawable *drawable = geode->getDrawable ( i ); if (drawable) { osg::Geometry *geom = dynamic_cast<osg::Geometry *> ( drawable ); if (geom) { getCurrentMaterial ( drawable ); QString nam = QString::fromStdString(drawable->getName()); PRCoptions grpopt; grpopt.no_break = true; grpopt.do_break = false; grpopt.tess = true; out->begingroup(nam.toLatin1(), &grpopt); for ( unsigned int ipr=0; ipr < geom->getNumPrimitiveSets(); ipr++ ) { osg::PrimitiveSet* prset=geom->getPrimitiveSet ( ipr ); analysePrimSet ( prset, out, geom, dynamic_cast<const osg::Vec3Array*> ( geom->getVertexArray() ) ); } out->endgroup(); } } } }
void PRCExporter::analyseGeode ( osg::Geode *geode, prcfile *out ) { getCurrentMaterial ( geode ); for ( unsigned int i=0; i<geode->getNumDrawables(); i++ ) { osg::Drawable *drawable=geode->getDrawable ( i ); osg::Geometry *geom=dynamic_cast<osg::Geometry *> ( drawable ); getCurrentMaterial ( drawable ); for ( unsigned int ipr=0; ipr<geom->getNumPrimitiveSets(); ipr++ ) { osg::PrimitiveSet* prset=geom->getPrimitiveSet ( ipr ); analysePrimSet ( prset, out, geom, dynamic_cast<const osg::Vec3Array*> ( geom->getVertexArray() ) ); } } }
void DebugDisplay::drawCube( AxisAlignedBox bbox ) { oht_assert_threadmodel(ThrMdl_Main); ManualObject * pManObj = _pSceneManager->createManualObject(); rollbackTransforms(bbox); pManObj->begin(getCurrentMaterial(), RenderOperation::OT_LINE_LIST); const Vector3 m0 = bbox.getMinimum(), mN = bbox.getMaximum(); pManObj->position(m0.x, m0.y, m0.z); pManObj->position(mN.x, m0.y, m0.z); pManObj->position(m0.x, m0.y, m0.z); pManObj->position(m0.x, mN.y, m0.z); pManObj->position(m0.x, m0.y, m0.z); pManObj->position(m0.x, m0.y, mN.z); pManObj->position(mN.x, mN.y, m0.z); pManObj->position(mN.x, m0.y, m0.z); pManObj->position(mN.x, mN.y, m0.z); pManObj->position(m0.x, mN.y, m0.z); pManObj->position(mN.x, mN.y, m0.z); pManObj->position(mN.x, mN.y, mN.z); pManObj->position(m0.x, mN.y, mN.z); pManObj->position(m0.x, mN.y, m0.z); pManObj->position(m0.x, mN.y, mN.z); pManObj->position(m0.x, m0.y, mN.z); pManObj->position(m0.x, mN.y, mN.z); pManObj->position(mN.x, mN.y, mN.z); pManObj->position(mN.x, m0.y, mN.z); pManObj->position(m0.x, m0.y, mN.z); pManObj->position(mN.x, m0.y, mN.z); pManObj->position(mN.x, m0.y, m0.z); pManObj->position(mN.x, m0.y, mN.z); pManObj->position(mN.x, mN.y, mN.z); pManObj->end(); _pScNode->attachObject(pManObj); }
void DebugDisplay::drawPoint( Vector3 p ) { oht_assert_threadmodel(ThrMdl_Main); ManualObject * pManObj = _pSceneManager->createManualObject(); rollbackTransforms(p); pManObj->begin(getCurrentMaterial(), RenderOperation::OT_POINT_LIST); pManObj->position(p); pManObj->end(); _pScNode->attachObject(pManObj); }
void DebugDisplay::drawTriangle( Vector3 t0, Vector3 t1, Vector3 t2 ) { oht_assert_threadmodel(ThrMdl_Main); ManualObject * pManObj = _pSceneManager->createManualObject(); rollbackTransforms(t0); rollbackTransforms(t1); rollbackTransforms(t2); pManObj->begin(getCurrentMaterial(), RenderOperation::OT_TRIANGLE_LIST); pManObj->position(t0); pManObj->position(t1); pManObj->position(t2); pManObj->end(); _pScNode->attachObject(pManObj); }