Page 1 of 1

Collision the mesh

Posted: Thu Jul 07, 2005 6:25 pm
by irado
how I can make the detention of a mesh animated in .md2 with one world in .3ds? The mesh in .md2 walking in the world.

the createCollisionResponseAnimator function does not function, and shows the message in the screen:

"CollisionResponseAnimator only works with same scene node as set as object during creation"

I tried the function getCollisionResultPosition but it did not execute the program.

Posted: Thu Jul 07, 2005 7:16 pm
by don_Pedro
I don't understand the problem, the message is "CollisionResponseAnimator only works with same scene node as set as object during creation", so create the createCollisionResponseAnimator with your .md2 mesh scene node as parameter, as it says.
That is createCollisionResponseAnimator:

virtual ISceneNodeAnimatorCollisionResponse* irr::scene::ISceneManager::createCollisionResponseAnimator ( ITriangleSelector * world,
ISceneNode * sceneNode, <- here put your mesh
const core::vector3df & ellipsoidRadius = core::vector3df(30, 60, 30),
const core::vector3df & gravityPerSecond = core::vector3df(0,-100.0f, 0),
const core::vector3df & ellipsoidTranslation = core::vector3df(0, 0, 0),
f32 slidingValue = 0.0005f
)

Then just add the ISceneNodeAnimatorCollisionResponse to the mesh, as you probably did, and that's all.

Posted: Thu Jul 07, 2005 9:09 pm
by Guest
I already had placed the animated mesh md2 in the place that you spoke, and already I had placed it of the type SceneNode and AnimatedSceneNode, but in the ones of the cases, the mesh md2 did not stop how much it collided with the mesh 3ds.

Posted: Fri Jul 08, 2005 1:37 pm
by irado
I already had placed the animated mesh md2 in the place that you spoke, and already I had placed it of the type SceneNode and AnimatedSceneNode, but in the ones of the cases, the mesh md2 did not stop how much it collided with the mesh 3ds.

Posted: Mon Jul 11, 2005 1:45 pm
by irado
nobody knows?

Posted: Mon Jul 11, 2005 4:16 pm
by irado
I already obtained.

sorry and thanks.

Posted: Sun Jul 17, 2005 9:14 am
by irkab1rka
I got the same message when I recreated my camera (I use fps and maya camera because i need to have a gui too) because I tried to reuse the animator object with a new camera. The solution in my case was to use the same fps camera all over (I never drop it or whatsoever) and switch the active camera by using the setActiveCamera method of the scene manager (usually called 'sgmr')
to switch the cameras. Of course to avoid flickering i copyed the position and the target of the fps camera to the maya camera by

Code: Select all

fps.setPosition(maya.getPosition());
fps.setTarget(maya.getTarget());
Both fps and maya are ICameraSceneNode instances. Let me know if you had the same problem.

Posted: Mon Jul 18, 2005 1:38 pm
by irado
in my problem I had not only added the entertainer to my node.
This is corret.

scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, mulher, core::vector3df(30,250,30),
core::vector3df(0,-3,0),
core::vector3df(1,0,0));
mulher->addAnimator(anim);
anim->drop();

I suggest that it places same animator for the two cameras.