roboticslibrary 简称rl库,sg里面的类按照scene / model / body / shape层次创建,在
class Body{
…
::rl::sg::Shape* create(::SoVRMLShape* shape);
…
}
是传入coin3d的vrmlshape来创建的
using namespace rl::sg::solid;
void test()
{
Scene* sce=new Scene();
Model* mde=sce->creat();
Body* bdy=mde->create();
SoDb::init(); //这个必须要调一次
//创建SoVRMLShape
SoVRMLShape* sosap0=new SoVRMLShape;
SoVRMLCone* cone0=new SoVRMLCone();
//设置cone参数
sosap->geometry=cone0;
//同样再创建sosap1
Shape* sap0=bdy->create(sosap0);
Shape* sap1=bdy->create(sosap1);
//下面判断colliding
bool flag= sce->areColliding(sap0, sap1);
delete sce;
}