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 / Need help with collision

Author
Message
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 22nd Sep 2008 01:32
I wrote this code and I want the player to be able to look around with the mouse and have collision so it is like a real game, but I can't figure out how to do anything.



(\__/)
(O.o )
(> < )This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Dragon Knight
17
Years of Service
User Offline
Joined: 10th Jan 2007
Location: Newcastle
Posted: 22nd Sep 2008 05:50
I'll teach you a little bit about box collision

Just to visualise it in your head picture a map x100 by y100 completly flat and you want to stop the "character"/Camera from going into a box
the box dimentions = 10 by 10
placed at x=50 by y=50 on the map

You'd have to create a box so to speak
e.g.

i use 45 and 55 as the dimensions of the box = 10 so i minus half of the box to get the left hand side position and add 5 to get the right hand side position

Same with up and down a.k.a. the y value

Another example depending on your level of programming would be:

Object position x(OBJECT ID) will retrieve where the object is situated at x and so forth..

I shall see if i can make a little example then get back to you, but hope that helps so far
Dragon Knight
17
Years of Service
User Offline
Joined: 10th Jan 2007
Location: Newcastle
Posted: 22nd Sep 2008 06:01
I've made you a nice small example.
P.s. the reason i made the box 10 but the collisions slightly bigger than i said before, was simply to not allow the camera to go inside the boxes even slightly...
pirate
18
Years of Service
User Offline
Joined: 18th Apr 2006
Location: u.s.a
Posted: 22nd Sep 2008 07:56
hey germ,
There is a tutorial that comes with dbpro...open dbpro...click on help...click help contents...then click tutorials...this tutorial even deals with bsp worlds...you can get all the movement,shooting collision...everything you are talking about...hope this helps...

thanks, pirate
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 22nd Sep 2008 09:08
Don't use a BSP as your world. I have got some code for fast collision with .x models, so you could use that instead.

The optomist's right, The pessimist's right.
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 23rd Sep 2008 00:24 Edited at: 23rd Sep 2008 00:24
Cool, I got collision working, I am just using the bsp world to test my code, I am going to make my worlds in .x format when I get to that point. dragon knight, your lesson really helped me understand collision, thanks.

(\__/)
(O.o )
(> < )This is Bunny. Copy Bunny into your signature to help him on his way to world domination!

Login to post a reply

Server time is: 2024-09-27 20:27:41
Your offset time is: 2024-09-27 20:27:41