code:
Code: Select all
IAnimatedMesh* mesh =myscene->getMesh("floor.3DS");
node=myscene->addAnimatedMeshSceneNode(mesh,0,FLOOR);
node->setMaterialFlag(EMF_LIGHTING,false);
ITriangleSelector* selector=myscene->createTriangleSelector(mesh->getMesh(0),node);
node->setTriangleSelector(selector);
IMetaTriangleSelector* metaSelector=myscene->createMetaTriangleSelector();
metaSelector->addTriangleSelector(selector);
mesh =myscene->getMesh("cube.3DS");
node=myscene->addAnimatedMeshSceneNode(mesh,0,CUBE);
node->setPosition(vector3df(0,100,0));
aabbox3d<f32> box_cube=node->getTransformedBoundingBox();
vector3df ellipsoidRadius = box_cube.MaxEdge - box_cube.getCenter();
ISceneNodeAnimatorCollisionResponse* anim =
myscene->createCollisionResponseAnimator(
metaSelector, //triangle selector della mappa
node
,ellipsoidRadius
,vector3df(0,-0.01,0)
,vector3df(0,0,0)
);
node->addAnimator(anim);
anim->drop();
why ??
If I change the position after the creation of animator, collision appears right but my element is stuck in to the ground and i cannot change his position.
thanks