Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Raycasting using Sparkys DLL --Example code--

Author
Message
Izzy545
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 18th Jul 2006 00:49
I figured this example might help some people learn how to do this. I found that using objects as bullets in shooter games was slow when I had a bunch on the screen, and I hated having to use standard collision checks(which were also slow) so I turned to Sparkys Collision DLL and his DBCIntersectObject. I made a quick media-free example of how to use it in a FPS type game. It's all commented out, you just need to download the DLL and put it in the same folder as this code.

DLL: http://forum.thegamecreators.com/?m=forum_view&b=5&t=31051&p=0

And the code:



I hope that this is helpful, and if anyone needs more help, then ask away and I'll help as best I can.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Aug 2006 13:21
Hi Izzy,

I'm having a lot of trouble with this dll. I don't understand how to set the intersect function to detect collision between two objects. Whatever I try, the only way the collision is detected is when the objects are completely overlapping. Is the intersect command the only command to actually detect the collision?

And I dont get the oldx oldy oldx x y z parameters. Is that from the center of the object to some distant point?

Enjoy your day.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 19th Aug 2006 13:29 Edited at: 19th Aug 2006 13:30
Sparky's DLL is used for raycasting. It "casts" an imaginary line from oldx,oldy,oldz to newx,newy,newz. Groups are used for using raycasting on only a selection of objects (when 0, it casts on all groups), and the object number is a number of any object that could be skipped.

The useful thing about the DLL is that it returns data like normals and bounce values.
+... It's fast!

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.

Login to post a reply

Server time is: 2025-05-25 08:46:45
Your offset time is: 2025-05-25 08:46:45