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.

Program Announcements / DB Sliding Collision Detection for X Models in DLL

Author
Message
SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 10th Mar 2003 03:12
Hi guys

"DB Sliding Collision Detection for X Models in DLL"

It's very easy to use, is totally Math based and is aimed at DB 1.13 developers who would like to use X Models for their worlds.

It's been a while coming but finally you can get it here:

http://www.nuclearglory.com/developer/db
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 10th Mar 2003 03:53
question 1
how do you include a .dll

q2:
is a 3ds support in the works?

q3:
does it aluto slide on a Matrix, objects, or both?

SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 10th Mar 2003 04:19
question 1
how do you include a .dll
See the included Examples for details but it's very easy.

q2:
is a 3ds support in the works?
Again - the example uses 3DS format. X or 3ds should work fine.

q3:
does it aluto slide on a Matrix, objects, or both?
No Matrix support is included. Matrices are made from tiles (squares) and this system works from Triangles. If you could work out the Triangles that make up your matrix then yes you could pass the vertices through using the "CreateCollisionVertex" method.

But hey, WHY use a matrix now? just model your landscape in 3D dude!

And yes it will slide against all walls of a model.
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 10th Mar 2003 05:37
well just thought id ask the idiots questions to prevent them later

expanding on one

"so its the same as including a mat edit file?"

lets see what else are common questions...

"can you control the speed of slide?"

SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 10th Mar 2003 06:11
I'm not used mat edit so couldn't say...basically you load your model as normal, create a mesh from the memblock, create a pointer to the mesh and send the pointer to the DLL. Then Once per frame you send your player/bullet/whatever's old & new positions through to the DLL and read back your adjusted position, the hit location or the normalized angle of the triangle you hit. Or all of the above

Speed of slide is determined by the angle at which you hit. So if you're going 100MPH and give a wall a slight glance then you'd slide a long way, hit it full on tho and you'd stop dead. Even if you were going fast enough to pass straight through in one frame
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 10th Mar 2003 06:38
what i mean can you control the "power" of gravity and what not liek in the demo

incendently it says

"DarkBASIC 1.13 users: Full Math based collision detection & sliding response on any loaded 3Dobject IS FINALLY YOURS for just a few lines of easy code!"

but their documentation of what that is meaning one has to figure it out on their own, if you going to go and scrap all you hard matrix work most folks arent going to comb through a sorce to find the magic 3 lines

MatthewGuy
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location:
Posted: 10th Mar 2003 08:39
Well, if you're planning on implementing any source of gravity, that's some physics code you would personally have to write to calculate new and old positions for the player to simulate gravity etc...

However, this is a collision system. And will adjust appropriately if your gravity throws objects into obstacles.

Furthermore, a few lines of code to fully handle polygon collision is nothing when your looking for a collision system you can actually use.

Fortunately it was not written as "... and you won't have to think ever again"

And for people who are sick of crazy collision, it's well worth finding those "magic 3 lines"

Couldn't resist

SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 10th Mar 2003 12:21
Thanks Matthew

LLX, I think you're pointing to the fact that the documentation of the DLL is not fantastic, and that may well be true as the driving force in the release of the DLL was the fact that the basic functionality was there so those that can may as well make use of it.

To try to help tho, here's a rundown, with actual code, of exactly what you need to do wo use the DLL in your programs

1) Define to friendly string variables the weird function names from the DLL. From now on in your program you can use your variable to reference the wierd name, which is far easier to remember:

and so on (just copy that section from the example dba files as )....

2) Load the DLL:


3) Check that the DLL is OK and (Optionally) that all its functions (methods) are available for use:


4) Load in a model you'd like to use as your World:


5) Make a Mesh out of the loaded model:


6) Make a Memblock from our new mesh:


7) Get a pointer (handle) to the New Memblock Mesh:


8) Tell the DLL to create a collision Mesh using our World model:


9) At the top of your game loop, store your player's OLD position:


10) After getting user input and working out the new postion of your player (as you normally would), Call the DLL method with your parameters:


11) Get the DLL to tell us where to put our player in case they hit something:


12) So these new co-ords can now be used to place you player:


13) Finally at the end of your program, delete the Reference to the DLL:



I hope that helps
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 10th Mar 2003 18:59
well it certinly save me th time of spendign a hour finding it on my own, as i was planing to do.

I don't mind thinking, most other programers DO so i'm playing devils advocate

lets see another DAQ

"Can i change those variable names you mentioned at first?"
and
"can i use function calls for the player input and movment"

if i think of anymore DAQ's i';; point um out, i probably wont use it until i can find a way to model a good terain though, as it stands now UFG hasa arena model but the matril terain/arena mix is still being used becase of my difficulty making a terain model

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Mar 2003 20:18
Well done! This will prove in useful, especially when I was fiddling with BSPS - this will prove a welcome change. However it's too late to make it into my current game, maybe the next one

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 11th Mar 2003 01:21
Thanks David - hope it helps

LLX, The weird function names may well be replaced by something more readable (thanks to Drake on the other board). Also I think more native DBPro support will be added soon too.

Of course you can use function calls for player movement but you do need to be able to pass the correct parameters to the DLL at some point in your loop.
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 11th Mar 2003 04:34
im gonna have to try merging my fighting game with this at one point and test the bugger im sure i can fine more DAQ then

Kohai of UWDesign
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: France
Posted: 11th Mar 2003 11:14
Angus, can we see a working example of it ???

Pliz ???

[Kohai]
[url]www.underwaredesign.com[/url] [url]www.kohaistyle.com[/url]
pIII 733/256 Ram/Geforce 256
SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 11th Mar 2003 12:04
Kohai, of course mate, just follow the link at the top of this thread.

Here it is again:
http://www.nuclearglory.com/developer/db

You can download a zip with examples from there
ZomBfied
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 11th Mar 2003 19:45
What about dbpro? I mean maybe there might be some advantage over dbpros native col detection?

MatthewGuy
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location:
Posted: 11th Mar 2003 23:58

Login to post a reply

Server time is: 2024-11-23 10:02:12
Your offset time is: 2024-11-23 10:02:12