Ellispsoid Collision Detection

BlitzMax Forums/BlitzMax Tutorials/Ellispsoid Collision Detection

Haramanai(Posted 2006) [#1]
This tutorial it’s about collision detection for games using ellipsoids.
The tutorial that created by Paul Nettle it’s at the location General collision detection for games using ellipsoids
Be sure to read it cause the only thing that you will find in this tutorial is the conversion of the psephtocode that it’s located at the end of article and the necessary tools that you will need to proceed all the steps.

First I am going to give you the the <Vector.BMX> that is a vector type originally created by SSS at the MaxPhisics Topic. I modified it a little bit make my life easier in the translation.
<Vector.Bmx>


After that I am giving you the <Rest.Bmx> that contains the intersection and IntersectSphere functions from the document and The type Colliders and some other necessary functions.
<Rest.Bmx>


Here I am giving you the Translation of the pseutocode from the article <CollisionDetection.Bmx>
<CollisionDetection.Bmx>


A Map editor to create some test maps. <MapEditor.Bmx> . This is a very simple map editor becareful that you must create all your polygons with the clockwise rule. You don’t have to close the polygons but you must know what you are doing. For example the lower level of the map can stay open.
After you created your leve copy paste from the output the nessacary code in the map file you are including in your test.
<MapEditor.Bmx>


Last I am Giving you a map <Map.Bmx>
<Map.Bmx>


And Last an overall Test. <Test.Bmx>
<Test.Bmx>



Be sure to create and store all the above files in the same directory. Run the test and navigate with the cursors keys. Jump with the Up arrow.
One last think the pseutocode it’s from the revision version of the document but the file CollisionDetection.Bmx contains all the code from the document. Like <’//> witch are the comments by the author and <’?> that is the code and some <’> that are mine.

Run it and see that with this way you can create much more realistic movement for you characters and you can climb stairs automatically.


I hope that I have not disturbed the community with all this because I all ready posted this stuff ( incomplete ) in the programming forum. But I believe this belongs here.


DreamLoader(Posted 2009) [#2]
this is nice!