Page 1 of 1

Trigonemetry/Geometry Library - Collision, Perimeter, Etc...

Posted: Mon Jun 12, 2006 12:21 pm
by Pritchard
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:

    Code: Select all

    Collision_Detection_Dimension(Boundary Type, Boundary Start, Boundary End, Object Position, Radius)
    Boundary Type is the value of which normal to use.
  • Spherical Against Spherical Collision
  • A ton of other stuff, really (function list below) :P

Type List:
  • Geo_Vector
  • Geo_Segment
  • Geo_Collision_Type
  • Enum: Geo_Option

Function List:
  • Segment_Collision
  • Object_Collision
  • Triangle_Collision
  • Closest_Point_On_Line
  • Get_Angle
  • Get_Cos_Angle
  • Get_Distance
  • Get_Dot_Product
  • Get_Endpoint
  • Get_Magnitude
  • Get_MidPoint
  • Get_Triangle_Perimeter
  • Normalize_Vector
  • Vector_Normal 'Normal between two vectors
So what are you waiting for? Test and complain to me about it people:

Download (Source + Lib - 50kb), .rar: Geo Math Lib

Posted: Mon Jun 12, 2006 12:25 pm
by MystikShadows
7000 fps?? where's 'HERE' ? NORAD computers??? LOL

I mean geez, I'll ahve to play 30 seconds ahead of time...push fire 20 seconds before I see anything because when I do, at 7000fps, I'll be dead before I know I had an accident. ROFLMAO

Posted: Mon Jun 12, 2006 1:03 pm
by Pritchard
MystikShadows wrote:7000 fps?? where's 'HERE' ? NORAD computers??? LOL

I mean geez, I'll ahve to play 30 seconds ahead of time...push fire 20 seconds before I see anything because when I do, at 7000fps, I'll be dead before I know I had an accident. ROFLMAO
I divide everything by the desired FPS, therefor, you less per frame as you get more FPS, so things should be just about the same until around 3000 fps. Unfortunately it's a pretty basic system in the examples, so there is a limit before things get slightly distorted.

Windows XP, 2.8ghz processor. The library actually goes a lot faster than that. The graphics putting are what slows it down :P Then again without graphics it'd be CPS (Calculations Per Second), not FPS.

Posted: Thu Jul 27, 2006 2:53 am
by Pritchard
Added documentation. Also, function overloading now present. I had previously thought ANY was casting the types for me (for whatever reason . . .)

^_^;; Well have fun. Most of the 1D functions will now accept/return all integers/singles/doubles now. I still recommend looking at the .bi's for a little help.

>_> Not the best documentation ever to be honest.

Download (Source + Lib - 50kb), .rar: Geo Math Lib