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 / Explaination of "make object collision box."

Author
Message
Epidemicz
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 5th Jan 2003 04:44
Hey, I was wondering if anyone could clear this up for me. Or actually show me an example?

I have a small sphere(object 1) and a building (object 2)

I want to be able to detect collision between them...So -> would I use the "make object collision box" command?

If so can somone please tell me what values I should put for X1, Y1, Z1, X2, Y2, Z2? Thats what I really don't get, that is, what to put for these arguments.

Maybe object position x(), etc..?

Thanks again in advance.
I am the very disease you pretend to be.
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 5th Jan 2003 06:24
What it is
The collision box ignores the object's verticies and uses an invisible box for collision. All the x and y values are quite simple. The first 3 are positive, the last 3 are negative. Each value should be HALF of the object's size.

What the values are
X1 should be half of the object's X length. This tells dark basic to make half of the X length of the collision box to match half of the X length of the object size.
X2 is the same thing, but in the opposite direction. Unless it's a non-cube object, it will be the same as X1, but NEGATIVE. All the 2's are negative, all the 1's are positive.
And Y1 and Y2 would be each be half the object's Y length
Y1 positive Y2 Negative
And same for Z. The box is lined up based on the object size

A bit more help
Then use the sliding collision examples in the tutorial section to see how the collision syntax should go.

The Syntax of the command
Make object collision box Object Number,Half object X, Half Object Y, Half Object Z, NEGATIVE Half object X, NEGATIVE Half object Y, NEGATIVE half object Z.

Example
So if you have a 4 by 4 by 4 box in the number 1 slot, here's what it would look like:
Make object collision box 1,2,2,2,-2,-2,-2

get it? good!
Epidemicz
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 5th Jan 2003 21:28
Ah, I see, heheh....Thanks man.

I am the very disease you pretend to be.

Login to post a reply

Server time is: 2024-05-02 11:13:42
Your offset time is: 2024-05-02 11:13:42