I'm tring to do collision response in a room. It works perfectly importing some cube's models I made, but importing this palm model of a human hand it has a strange behaviour: when I try to collide with it I can't go trought it (and this it's good) but I can't go away from the node!
Just to understand the behaviour, it seems like there's an attraction which don't let me go away from the palm I've imported if I collide with it.
I create the palm node as follow:
Code: Select all
scene::ISceneNode* palm= 0;
palm= smgr->addOctTreeSceneNode( smgr->getMesh(mesh_file) );
if (palm)
{
palm->setPosition(position);
palm->setMaterialTexture( 0, driver->getTexture(texture_file) );
obj_selector = smgr->createOctTreeTriangleSelector( smgr->getMesh(mesh_file)->getMesh(0) , palm);
palm->setTriangleSelector(obj_selector);
obj_selector->drop();
world_selector->addTriangleSelector(obj_selector);
Then I make collision response on tha camera:
Code: Select all
scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(0, 30.0f, 20.0f, -1, 0, 0, false);
camera->setPosition(core::vector3df(0,40,-20));
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(world_selector, camera, core::vector3df(2,2,2),
core::vector3df(0,-0,0), core::vector3df(0,0,0));
Maybe I created a corrupted model (if so, could anyone explain me what I did wrong on it?) , or maybe Irrlicht has some problem to create an ITriangleSelector* from a complicated mesh?