Collision Response Animator question
-
lostclimategames
- Posts: 331
- Joined: Sat Sep 02, 2006 4:11 am
- Location: Michigan
- Contact:
Collision Response Animator question
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?
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.
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 ~!!
You create metatriangle selector.
In your world add all ur world props for example
single Collision response animator is enough.
regards
anandh
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();
regards
anandh
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
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.
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
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
