Lets say I have two specific Scene Nodes.
A Sword, and an Enemy.
And I Want to check and see if they have collided with each other, but I can't find any function to do so.
I've read the irrlicht documentation up an down, and I still don't quite get what to do.
Simple collision Question.
If you know the players position (who i'm going to assume is swinging the sword) and the enemy position then you should be able to determine if the sword is going to hit or not. This would probably be the fastest solution as it only requires two values sent at a specific time. The other options would be using something like a bounding box around your sword and another bounding object around your enemy and comparing each during the fight. To go even deeper as to determine where the enemy was hit, you would probably have to delve into the vertex buffer to compare which points are closest to your sword edge.
Last edited by zeno60 on Tue Sep 11, 2007 1:55 am, edited 1 time in total.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Irrlicht supports line/box and line/mesh collisions via its collision manager. See example 07. Collision.
Unfortunately, it has no built in updating a triangle selector from an animated mesh. You could try this patch that I wrote last year, roll your own, or go with an external library like OPCODE or Newton.
Also: please search the forums; this question has been asked and answered comprehensively approximately 3,627,295 times before.
Unfortunately, it has no built in updating a triangle selector from an animated mesh. You could try this patch that I wrote last year, roll your own, or go with an external library like OPCODE or Newton.
Also: please search the forums; this question has been asked and answered comprehensively approximately 3,627,295 times before.
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
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Right, I've updated and uploaded a candidate patch that enables triangle selectors to be built from animated mesh scene nodes. The selector will get updated automatically when necessary (i.e. when the animated mesh from which it's created has changed).
It still doesn't allow mesh-mesh collisions, just ray-mesh, but that should be sufficient for a sword; you just need to create a ray that represents the edge or centre of the sword.
Then you can do intersections trivially with getSceneNodeFromRayBB() and getCollisionPoint(). See the modified example 07. Collision for how to do that.
It still doesn't allow mesh-mesh collisions, just ray-mesh, but that should be sufficient for a sword; you just need to create a ray that represents the edge or centre of the sword.
Then you can do intersections trivially with getSceneNodeFromRayBB() and getCollisionPoint(). See the modified example 07. Collision for how to do that.
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