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 / Spherical collision is actually boxes

Author
Message
Ratty Rat
23
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 9th Apr 2003 12:45
The code below creates a sphere and a box, sets spherical and box collision then allows you to move the sphere around to check when it collides.

It is immediately obvious that the spheres collision area is in fact a box, not a sphere.

Does everyone else get the same ?



This is getting really annoying, I have been constantly going back to my ball game every time a new patch appears and every time there is something new which stops it from proceeding.
Well, at least with this one I can continue coding and hope it eventually gets fixed.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 9th Apr 2003 14:00 Edited at: 9th Apr 2003 15:57
Are you sure. Remember, the sphere WILL use spherical collision, but the object it is being tested against will use box collision, regardless of what you set it to, and a positive will occur if the sphere intersects the box.

Apparently, PROPER polygon collision is coming down the line somewhere.

Current Project: Retro Compo. Entry.
Ratty Rat
23
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 9th Apr 2003 14:37
Rob - this is one I have been battling with for some time so Yes I am sure.

Run the program and you will see, the sphere is actually colliding in its start position, which I purposely set at a point as if 2 boxes were just touching, not 1 box and 1 sphere.

Moving the sphere around the collision acts just like a cube IE if you put the sphere on the boxes side (rather than a corner) it correctly collides just as the edge of the sphere hits the box, If you put the sphere on a corner of the box however it continues to collide until it gets to the edge of an apparent box surrounding the sphere, rather than the sphere.

"Don`t try to engage my enthusiasm, I don`t have one"
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 9th Apr 2003 15:56 Edited at: 9th Apr 2003 15:57
Ratty, it DOES work properly, if you swap the collision parameters:

replace:

if object collision(1,2) then text 0,33,"COLLIDED"

with

if object collision(2,1) then text 0,33,"COLLIDED"

Current Project: Retro Compo. Entry.
AtomR
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 9th Apr 2003 17:03
Either way you use the collision parameters it behaves the same (as it should). A sphere colliding with a box is the same as a box colliding with a sphere so the order shouldn't be relevant. And the sphere does seem to have a collision box instead of a collision sphere.

Take care
AtomR
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 9th Apr 2003 17:11
It does make a difference for me. The object given for the FIRST parameter always uses the collision that you specified, the object given for the SECOND parameter always uses box collision or sphere collision in the case of polygon collision. The reason is that Lee is still learning how to do proper polygon collision, so hopefully we should see that as a feature soonish.

Current Project: Retro Compo. Entry.
Ratty Rat
23
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 9th Apr 2003 19:23
This really looks like we are all getting different results, Rob - when I swap the parameters it actually makes it worse, its suddenly as though one of the objects is twice its size, but both still acting as boxes!

I mailed them about this one, no reply yet....

"Don`t try to engage my enthusiasm, I don`t have one"

Login to post a reply

Server time is: 2026-07-10 19:48:21
Your offset time is: 2026-07-10 19:48:21