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 / Sparkys Collision Assistance

Author
Message
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 20th Jan 2009 16:16
Hi guys, Just been fiddling around with some old code I dug up and woundered if you could help me get collisions working between the cube and the terrain?



Also, any advice on how to make terrain into a object would be hugely helpful.

Thank you,
Violent Pigeon


Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 21st Jan 2009 20:01
Nothing?


puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 22nd Jan 2009 03:50
I don't use dbpro but I'd imagine you'd do something like this-

OldX = CameraPositionX
OldY = CameraPositionY
OldZ = CameraPositionZ

all of the things that move the camera around here

NewX =CameraPositionX
NewY =CameraPositionX
NewZ =CameraPositionX


and this would handle collision (object 1 is a sphere around the player btw)

Collide = SC_SphereSlide 0, OldX, OldY, OldZ, NewX, NewY, NewZ, 25

SC_UpdateObject 3

if collide > 0
CollideX = SC_GetCollisionSlideX
CollideY = SC_GetCollisionSlideY
CollideZ = SC_GetCollisionSlideZ

positionObject 1, CollideX, CollideY, CollideZ

or something like that...
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 22nd Jan 2009 12:34
Thank you for the help, in the mean time I have just got Dark Physics and will probably end up using that for collisions now xD

Thank you,
Svothe


Monk
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 18th Feb 2009 18:41
As for making the terrain into objects...
try making a memblock matrix, that makes the matrix into objects.

Login to post a reply

Server time is: 2024-09-28 02:29:20
Your offset time is: 2024-09-28 02:29:20