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

Announce and discuss the progress of your various programming-related projects...programs, games, websites, tutorials, libraries...anything!

Moderators: Pete, Mods

Post Reply
Pritchard
Coder
Posts: 15
Joined: Mon Jun 12, 2006 12:19 pm

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

Post 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
Last edited by Pritchard on Thu Jul 27, 2006 2:52 am, edited 1 time in total.
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post 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
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
Pritchard
Coder
Posts: 15
Joined: Mon Jun 12, 2006 12:19 pm

Post 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.
Pritchard
Coder
Posts: 15
Joined: Mon Jun 12, 2006 12:19 pm

Post 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
Post Reply