Thanks to Relsoft, Dr. D, and me putting myself in Geometry, I am able to release this library. Relsoft and Dr. D deserve all credit for teaching me collision detection :P
This library's uses pretty darn fast methods. The 2D physics AND Collision.bas goes around 7000 frames per second here.
Download (Source + Lib - 50kb), .rar: Geo Math Lib
Note: Was compiled under Windows XP. If you have trouble with it and it's not a lower than .16 issue, try compiling it yourself.
The Lib Supports the Following:
Tested on Version .16 Unstable, so no guarantees for you .15'ers
1D, 2D, and 3D Trigonometric Functions with Single Digit Precision
Spherical Against Line Segment Collision Detection for All Dimensions Supported:
Finally! I have just added Object to Object (Circle to Circle) collision. Updated link in first post.
Changed:
Collision_Detection_2D is now Called: Segment_Collision
Object to Object Collision is called: Object_Collision_2D (only 2D is available)
New Option Added for Object_Collision - First parameter is an Enum. Either Geo_Physics or Geo_No_Physics. Geo_No_Physics won't return the normals, so it's slightly faster.
Zamaster wrote:how bout we use it in ATTO.... atto anyone? atto please? I WANT ATTO!!!!
I had already planned to use line-collision detection in atto. The ships will have a line-loop describing the outside edges and if weapons fire crosses one of said lines, then a hit will be scored.
1000101 wrote:I had already planned to use line-collision detection in atto. The ships will have a line-loop describing the outside edges and if weapons fire crosses one of said lines, then a hit will be scored.
Hahah. Add this line to the Object_Collision_2D, then compile and run Object_Collision.bas in the Two Dimensional examples folder:
It's an interesting bit of a math lib, I'll have to take a look at it a bit more. However, we're not that far yet. We're still working on code even before that happens. Once we have something too collide, then we'll worry about checking for that :D
elcalen wrote:Type Geo_Segment_1D is dublicated in the .bi file. Gave me an error when I tried to compile it...
Also you have this line in the examples: #include "Fbgfx.bi". You should use "fbgfx.bi" for it to compile in Linux. Linux is case sensitive!
I've only tried one or two examples, but looks good so far. Thanks, mate.
Thanks for the complements and complaints! Geo_Segment_1D is duplicated because I added it at the last minute. I only had it for one dimension because I never used it, so I forgot all about it.
Case sensitivity is important. I'll have to remember that! Be right back in a minute with the update!