Create collision respons animator

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
Obeleh
Posts: 28
Joined: Tue Oct 02, 2007 7:46 am

Create collision respons animator

Post by Obeleh »

I noticed that the collision response animator is only for collisions between ISceneNode and the World. Is there a collision response animator for collisions between ISceneNode and another ISceneNode?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Why do you think it's only for collisions between an ISceneNode and the world?

It's actually for collisions between an ellipsoid and any triangle selector you wish. The triangle selector could be your world or it could be a single node or many nodes or everything you could imagine in your environment.

What you could probably do to prevent collisions between two nodes is to have two collision animators, one for each node, and when creating the animator pass in the triangle selector of the other node and define the ellipsoid to enclose the parent node of the animator.
Image Image Image
Obeleh
Posts: 28
Joined: Tue Oct 02, 2007 7:46 am

Post by Obeleh »

Could you rephrase that last part?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Something like this:

CollisionAnimator anim1 = createCollisionAnimator(node1Ellipsoid, node2TriSelector);
node1->addAnimator(anim1);

CollisionAnimator anim2 = createCollisionAnimator(node2Ellipsoid, node1TriSelector);
node2->addAnimator(anim2);

This code is not valid irrlicht code, you'll have to look up the correct functions and parameters, this is basically just pseudocode.

I also can't guarantee that this will work, but it's worth a try!
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Ooh, hella expensive though. You'll want to do sphere-sphere and/or bounding box tests on the nodes first, before doing down to triangle collisions.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Fo' shizzle rodge, i reckoned this was the simplest route before delving into the complex world of optimisations :lol:
Image Image Image
Post Reply