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 Professional Discussion / Help with this code...

Author
Message
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Sep 2003 17:47
Ok, here is a snip from my main loop


this works fine to control my character within a bsp world. Up moves forward, down moves back, left/right side-step, and mouse looks in all directions.

Since AUTOMATIC OBJECT COLLISION doesn't work with BSP collision (Confirmed BUG - see bug forum) I need to add some manual collision handling when the player encounters objects that are NOT bsp geometry, such as a 3ds object I create. I need to incorporate this extra code to "stop" the player if he hits an object, but without getting "stuck" to the object. Since a am new to this whole concept I was hoping someone could give me a start. The new snip is where I need the help...



I don't fully follow the rotations/positions in 3d space as I am new to these concepts.
Thanks

-RUST-
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 6th Sep 2003 22:22
Hehe, sliding collision, arguably the hardest thing to implement well in DB/DBP . Good luck...

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Sep 2003 00:20
NOOOOOOOOOOOOO!

I don't wanna slide - just stop from whatever angle I hit object...
I have ideas of how to go about it, but was seeking some more experienced advice

nooooo

-RUST-
Flashing Blade
23
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 7th Sep 2003 02:45 Edited at: 7th Sep 2003 02:47
this is what i do:

if distance between ob1 and ob2 is less than velocity + widths involved then do this:
slide up in small units checking for collision - ie if velocity is 10 then:
for x=1 to 40
move 0.25
collision check
next x

if collision then go back in smaller steps until you not hitting:
repeat
move-0.1
until no collision
move 0.1

sync



very important to do maths check before sliding collision.

dunno if my way is good or bad but it works for me.
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Sep 2003 03:59
thanks
I'll try it

-RUST-

Login to post a reply

Server time is: 2026-07-23 07:42:26
Your offset time is: 2026-07-23 07:42:26