Create collision respons animator
Create collision respons animator
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?
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.
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.
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!
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!
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
