Code: Select all
IAnimatedMesh *Mesh=smgr->getMesh("20kdm2.bsp");
IAnimatedMeshSceneNode *MapNode=smgr->addAnimatedMeshSceneNode(Mesh,worldNode);
MapNode->setPosition(vector3df(map->mapoffset[0],map->mapoffset[1],map->mapoffset[2]));
MapNode->setMaterialFlag(EMF_LIGHTING,false);
CIrrOdeGeomBox *map=reinterpret_cast<CIrrOdeGeomBox *>(smgr->addSceneNode(
CIrrOdeSceneNode::nodeNameToC8(IRR_ODE_GEOM_BOX_NAME),
MapNode));
map->getSurfaceParameters(0)->setBounce(1.0f);
map->getSurfaceParameters(0)->setModeBounce(true);
map->drop();
Code: Select all
CIrrOdeBody *pBody=reinterpret_cast<CIrrOdeBody *>(
smgr->addSceneNode(CIrrOdeSceneNode::nodeNameToC8(
IRR_ODE_BODY_NAME),worldNode));
pBody->setPosition(vector3df(0.0f,15.0f,0.0f));
Mesh=smgr->getMesh("data/sphere.3ds");
IAnimatedMeshSceneNode *Node2=smgr->addAnimatedMeshSceneNode(Mesh,pBody);
Node2->setMaterialTexture(0,driver->getTexture("data/sphere0.jpg"));
Node2->setMaterialFlag(EMF_LIGHTING,false);
CIrrOdeGeomSphere *pSphere=reinterpret_cast<CIrrOdeGeomSphere *>
(smgr->addSceneNode(CIrrOdeSceneNode::nodeNameToC8(
IRR_ODE_GEOM_SPHERE_NAME),Node2));
pSphere->setMassTotal(0.5f);
pSphere->getSurfaceParameters(1)->setBounce(1.0f);
pSphere->getSurfaceParameters(1)->setModeBounce(true);
pSphere->drop();