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.

Newcomers DBPro Corner / Static Collision Detection Question

Author
Message
Elric
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 15th Mar 2003 22:19
Hi,

I'm a relative noob to DB - just been using DB Pro for a week - and having a problem with static collision boxes. I've included simple stripped down code below (I hope - if the posting works..)

Sorry if this is the wrong place for this question - if so please tell me where I should stick it (so to speak..)

The code creates a sphere and a series of boxes on a matrix. You can move the sphere, and sliding collision detection seems to be working when it hits the boxes. It's fine as long as you move, but if you move next to the boxes and take your finger off the key - it 'jumps' the sphere back a little way.

I figure I've missed something in the code - can anyone offer any advice or point me in the right direction please coz I can't see it!?

Cheers!

Code (NB - created in DBPro - unpatched)

"The question isn't who is going to let me; it's who is going to stop me." - Ayn Rand
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 15th Mar 2003 22:35
Try this:



The problem is (I think) that even when not moving, the program calculates the sliding collision and positions you where you should be if you were moving, so what I did here was to tell the program when you're moving and when your not, and only to calculate sliding collision when you are moving. Hope this helps

Whatever I did I didn't do it!
Elric
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 16th Mar 2003 03:44
that works a treat!

you sir, are a star - many thanks!



"The question isn't who is going to let me; it's who is going to stop me." - Ayn Rand

Login to post a reply

Server time is: 2024-11-24 06:13:58
Your offset time is: 2024-11-24 06:13:58