Collision the mesh

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
irado
Posts: 22
Joined: Mon Jun 20, 2005 4:46 pm

Collision the mesh

Post 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.
don_Pedro
Posts: 84
Joined: Fri Jun 10, 2005 1:34 pm
Location: Poland
Contact:

Post 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.
Guest

Post 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.
irado
Posts: 22
Joined: Mon Jun 20, 2005 4:46 pm

Post 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.
irado
Posts: 22
Joined: Mon Jun 20, 2005 4:46 pm

Post by irado »

nobody knows?
irado
Posts: 22
Joined: Mon Jun 20, 2005 4:46 pm

Post by irado »

I already obtained.

sorry and thanks.
irkab1rka
Posts: 9
Joined: Sat Jul 09, 2005 8:06 pm

Post 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.
irado
Posts: 22
Joined: Mon Jun 20, 2005 4:46 pm

Post 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.
Post Reply