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 / Sliding Collision in Sparky's DBC

Author
Message
Bizar Guy
21
Years of Service
User Offline
Joined: 20th Apr 2005
Location: Bostonland
Posted: 27th Apr 2008 11:20 Edited at: 27th Apr 2008 21:56
Hi, I've gotten to a point where I can't avoid the fact any longer that DBC's sliding collision sucks. I can't just wok with boxes anymore. I've been trying to learn how to do polygon sliding collision along with ramps with Sparky's in DBC, and haven't had much success. zzz gave me a helpful tut he had used himself, but I couldn't get very far with it.

Basically, I need to translate this code into sparky's so that it will deal with polygon collision, ramps, and still allow me to work with the gravity at any time outside of this goto.



I'm really stuck on this one, and so all I can think to do. I've just tried so many different things with sparky's and I just can't work it out; it doesn't seem to follow the same set of logic I use in most of my coding, or I just don't understand it yet. I'm posting the bare bones native sliding collision and gravity I'm using, in hopes that someone will see it and know the sort of thing I'm looking for.

Profit
20
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 28th Apr 2008 00:15 Edited at: 28th Apr 2008 00:18
O.K.
When you load an object that you want to use with collision detection, call "sc_setupobject". If you move or rotate an object call "sc_updateobject".

Your code becomes:



Hopefully that works.... I've no way to try it out.

I didn't know what the last 2 lines were for so I left those alone. I'm not sure if you wanted to just port your example over to Sparky's (which I did), or you wanted a complete rewrite.

Give the code a try (remember to add "sc_setupobject" though )

Btw, I did that using DBP version help files. Shouldn't be too far away from DBC commands though.

Good luck, and I hope that I helped.

Bizar Guy
21
Years of Service
User Offline
Joined: 20th Apr 2005
Location: Bostonland
Posted: 28th Apr 2008 10:47 Edited at: 28th Apr 2008 10:48
Unfortunately, the DBC version of sparkys (or at least the one I have, I don't know if there is a new one for DBC, I know someone made an updated version for the DBpro version) does not have and sc_ type commands. I saw some examples of those and was wishing I had something like that.

I tried it though, just to make sure, but it didn't work. Thanks for posting it though.

Oh, and those bottom two commands are checks for a ground to stop gravity and a ceiling to cancel gravity. They're being changed up a bit to more advanced stuff now that I'm building a physics engine- the very reason I need sparkys.

Profit
20
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 28th Apr 2008 14:50
Sorry, I probably should've checked the help file before posting.

But now I did.

It looks like you would need to change:
"sc_setupobject" to "setupobjectdbc"
"sc_updateobject" to "updateobjectdbc"

Even so, there's no replacements for "sc_objectcollision" or "sc_getcollisionslide".

I think we're going to need to go with raycasting on this one (because from what I can tell, that's the only way to detect collisions in the DBC version).

I will add you to MSN so we can get this settled.

Bizar Guy
21
Years of Service
User Offline
Joined: 20th Apr 2005
Location: Bostonland
Posted: 28th Apr 2008 16:20
thanks, I'll be free most of tomorrow (were both US, so tomorrow should be the same general time).

Login to post a reply

Server time is: 2026-07-05 17:54:58
Your offset time is: 2026-07-05 17:54:58