Collision Response Animator question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
lostclimategames
Posts: 331
Joined: Sat Sep 02, 2006 4:11 am
Location: Michigan
Contact:

Collision Response Animator question

Post by lostclimategames »

how do you get a collision response animator to react to several different objects, or do you just make several of them for each object?
___________________________
For all of your 3D/2D resource needs:
Image
seno
Posts: 34
Joined: Thu Nov 17, 2005 2:50 am
Location: Seoul Korea

Post by seno »

Need to create animator for each object which is wished to be collided.

For example, you have player character object A, wall B and Terrain C. If you want to make A want to be collided with B and C, you need to create collision animator ONE for B to affect A and collision animator TWO for C to affect A. However, if the wall B moves to C, it won't be collided. Remeber, the animator is the object which recalculate the position of the SceneNode who contains it and it works in the order of being added.

By the way, some scene nodes do not use the animator, like Maya Camera.
Let's Take Over the World ~!!
anandh
Posts: 61
Joined: Thu Sep 14, 2006 12:40 pm
Contact:

Post by anandh »

You create metatriangle selector.
In your world add all ur world props for example

Code: Select all

scene::IMetaTriangleSelector* world = smgr->createMetaTriangleSelector();   
//Fire
scene::ISceneNode* fire = 0;	
scene::ITriangleSelector* fireselector = 0;
fire = smgr->addTestSceneNode();
fireselector = smgr->createTriangleSelectorFromBoundingBox(fire);
fire->setTriangleSelector(fireselector);
world->addTriangleSelector(fireselector);
fireselector->drop(); 
//player
.
.
.
.
//your collision response animator
scene::ISceneNodeAnimator* anim;
anim = smgr->createCollisionResponseAnimator(
world, player, core::vector3df(10,8,50),
core::vector3df(0,gravity,0), 
core::vector3df(0,0,0));
player->addAnimator(anim);
anim->drop();
world->drop();
single Collision response animator is enough.

regards
anandh
Sundar
Posts: 84
Joined: Mon Jun 05, 2006 11:05 am

Post by Sundar »

It depends

in seno`s example

you have player character object A, wall B and Terrain C

we actually can combine the tri selector for B & C and create a metaTriangle selector WORLD

So player can have only one collision response animator pointing to WORLD.

But if we have two characters whom we want to check for collision then we should have a collision response animator for player with WORLD & another collision response animator for player with Each characters

regards
Last edited by Sundar on Tue Oct 03, 2006 10:00 am, edited 1 time in total.
anandh
Posts: 61
Joined: Thu Sep 14, 2006 12:40 pm
Contact:

Post by anandh »

its fine sundar
How we can differentiate the 2 collision response animator .
Is there is any way to find the ID of the particular collided scene node.

regards
anandh
Sundar
Posts: 84
Joined: Mon Jun 05, 2006 11:05 am

Post by Sundar »

Why you want to find ID.

Because on collision the response will be automatic . Thats why we are using collision response animator.

But if you want to do something else than collision then either you have to inherit collision response animator and get the collision event or try to write a call back in CR animator itself

regards
Sundar
Sundar
Posts: 84
Joined: Mon Jun 05, 2006 11:05 am

Post by Sundar »

sorry forgot to answer first sentence

You Dont have to diffrentiate 2 collision response animator

Remember a scene node can have more than one animator.


i am not very sure is it possible to have more than one CR animator.

though my intuition says it should be posssible. i ll try it and confirm it
Post Reply