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.
Collision the mesh
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.
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.
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
Both fps and maya are ICameraSceneNode instances. Let me know if you had the same problem.
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());
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.
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.