Im currently working on a full easy-to-use Math Collision System.
No DLL-calls required, because all work is done in darkbasic Functions.
Here's a screenie of a "snow scene", when a cube hits an object it will get repositioned in the air. NO FPS LOSS:
How it works:
You just copy all of the functions (YES, its open-source) into your project. Then you just call the functions and its done. This is the code that made the "snow scene" work:
do
camera_speed# = 0.0
yrotate camera wrapvalue(camera angle y()+mousemovex())
xrotate camera wrapvalue(camera angle x()+mousemovey())
if upkey()=1 then camera_speed# = 0.7
update_world(1,2,camera_speed#,ymov,gravity,0.01,camgrav,0.0)
for b=101 to 120
object_status = 0
object_status = update_object(1,2,b,gravity,0.1,object position x(b),object position y(b),object position z(b),0.5,0,0.0)
if object_status > 0 then position object b,object position x(b),40,object position z(b)
next b
text 5,5,str$(camera position x())
text 5,20,str$(camera position y())
text 5,35,str$(camera position z())
text 5,50,"FPS = "+str$(screen fps())
text 5,65,"Start nr = 1"
text 5,80,"End nr = 2"
text 5,95,"Speed# = 0.2"
text 5,110,"Y-movement = "+str$(ymov)+" Y to turn on/off"
text 5,125,"Gravity = "+str$(gravity)+" G to turn on/off"
text 5,140,"Grav-Speed# = 0.1"
text 5,155,"Cam-Gravity = "+str$(camgrav)+" C to turn on/off"
text 5,170,"Lowest Height = 0.0"
if lower$(inkey$())="y" then ymov = abs(ymov - 1) : wait 50
if lower$(inkey$())="g" then gravity = abs(gravity - 1) : wait 50
if lower$(inkey$())="c" then camgrav = abs(camgrav - 1) : wait 50
sync
loop
You can control everything, when you update an object you can even get the result. In the code above, object_status holds the result value.
When you've copied the functions, you must place the collision data into your scene, using a special tool (im still working on the tool)
This system supports:
1 = box collision
2 = sphere collision
3 = stair/slope - x
4 = stair/slope - z
5 = ellipsoid
6 = x-cylinder
7 = y-cylinder
8 = z-cylinder
9 = cone
10 = pyramid
11 = rotated stair/slope
Any negative value = object positions, for platforms or moving objects.
Bouncing objects is a piece of cake! Just call update_object. If it returns a number above 0 then respond to it. Get the angles for example and rotate/move it.
"Snow Scene" Download link:
http://www.geocities.com/hatesurvivor/MathColl.zip
<right-click, save target as>
I will work on a better example if I got the time.
Quote: "
UPDATED
Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb"