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 Discussion / Static-obj. collision concept?

Author
Message
Jack Nukem
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location:
Posted: 13th Aug 2004 04:52
I Don't think I understand how the collision detection work with
Static objects. First, as I understand, making static objects means
making one group out of many objects (because if I want to delete
static object, I must delete all of them). Second, what if for example I make two static cubes that are not close to each other,
how can I detect collision with each one of them?

And what is "Occlusion Mode" used for?
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 13th Aug 2004 17:06
From my understanding of static collision, you first must make a collision box for the object to be hit.

make static collision box x1, y1, z1, x2, y2, z2

the coordinates are the upper-forward-right and bottom-backward-left corners of the box created. The you can use the collision commands;

get static collision hit()
get static collision x()
get static collision y()
get static collision z()

to detect them

Now for occlusion. Occlusion is the quanty of "being covered" or "covering" other objects, making the rendering list shorter. (As in a wall that hide a monster or player behind it.) If occlusion is not on, the objects behind the static object is still drawn, even though they ultimately cannot be seen because the static object covers them.

(gee I hope I said that right.)
S.

Any truly great code should be indisguishable from magic.
Jack Nukem
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location:
Posted: 13th Aug 2004 18:14
First, thanks for the help.

As I understand, the static collision box is an invisible border built around entire group of static objects, right?

Second, what all the parameters in the "get static collision hit()"?
How I use it?
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 13th Aug 2004 18:38 Edited at: 13th Aug 2004 18:39
Okay, from the manual;

Quote: "

get static collision hit()
You can use this command to detect whether a specified area within your 3D world is touching a static collision box. By specifying old and recent positions of the specified area, this command not only returns a one if a collision has occured, but fills the get static collision x, y and z expressions with the adjustment values. Applying these vales to an object or entity will give the impression of sliding collision.

return value-get static collision hit(oldx1, oldy1, oldz1, oldx2, oldy2, oldz2, newx1, newy1, newz1, newx2, newy2, newz2)


"


good luck!
S.

Any truly great code should be indisguishable from magic.
Elthan
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Spain
Posted: 13th Aug 2004 20:11
How could I delete static collision boxes? Create it is very easy but I cant use the same location to place another level.
Thanks.
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 13th Aug 2004 23:38
As far as I know, you simply re-define it, not deleting at all really. Since the static world doesn't move, the box defined is just that; an invisible box drawn around the values given.

Any truly great code should be indisguishable from magic.
Hop a long
21
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 14th Aug 2004 12:41 Edited at: 14th Aug 2004 12:48
Hi Jack
Here is a short example that uses static object collisions.
http://www.geocities.com/hifin2003/jump.html.

Quote: "Second, what all the parameters in the "get static collision hit()"?
"

The parameters you mention are the difference between the moving object's old and new positions.
The example code really was written to explain jumping. Hopefully the extra information will not be confusing.

Login to post a reply

Server time is: 2025-05-25 09:56:24
Your offset time is: 2025-05-25 09:56:24