how do you add a collision box?
by Jeff Wilkinson · in Torque Game Engine · 02/26/2002 (7:15 pm) · 10 replies
Just wondering how do you add a collision box in 3d studio max?
#2
09/18/2002 (3:57 pm)
It is not well explained. It is very vague and does not work.
#3
First make an object, a box will do fine, which surrounds the object you want to be colliding into. As a test the easiest thing to do is to copy the bounding box. Call it Col-1. Then create a dummy object, like the detail markers, and call it Collision-1. That's it.
If you want to have more complex collision geometry you can make additional shapes, like the box, and name them Col-2, Col-3, etc. For each Col object you have you need to create a Collision dummy object with the same negative number as the Col object.
Alc
09/18/2002 (4:43 pm)
The explaination is fine but it can be confusing. First make an object, a box will do fine, which surrounds the object you want to be colliding into. As a test the easiest thing to do is to copy the bounding box. Call it Col-1. Then create a dummy object, like the detail markers, and call it Collision-1. That's it.
If you want to have more complex collision geometry you can make additional shapes, like the box, and name them Col-2, Col-3, etc. For each Col object you have you need to create a Collision dummy object with the same negative number as the Col object.
Alc
#4
in regards to the complex collision geometry and the adding of shapes... so say I have an L shaped wall... two overlapping boxes would work fine yes? now from http://www.garagegames.com/docs/torque/tools/max2dts/section1.html#ss I understand this as saying that the bounding box must be called 'bounds'...how does this work with more than one bounding box? Please forgive my lengthy questions, but I've been dying here trying to figure this out on my own without asking....
09/19/2002 (5:57 am)
I'm not sure that one helped much more. I understand now that I have to create a box bigger than the object. Transparent? Seems like it's going to be hard to see how close the bounding box to my object is going to be...maybe not. Obviously I haven't done this before but I've been searching for 4 days for something related to bounding boxes and this is the first helpful thing that I've found. Now what is the test part? Why am I copying it? and is this in 3ds? Not TOO worried about the collision stuff yet...just, questions. I just want to be able to export things right now to start building.in regards to the complex collision geometry and the adding of shapes... so say I have an L shaped wall... two overlapping boxes would work fine yes? now from http://www.garagegames.com/docs/torque/tools/max2dts/section1.html#ss I understand this as saying that the bounding box must be called 'bounds'...how does this work with more than one bounding box? Please forgive my lengthy questions, but I've been dying here trying to figure this out on my own without asking....
#5
TIA
09/19/2002 (7:05 am)
Can a pyramid be one collision mesh? Just trying to get a collision mesh to be as close to the model as possible. I understand that each collision mesh adds process time but was wondering how complex/convex can the mesh be. Does it have to be a box/rectangle? What are the limits to mesh complexity? As long as the shape isn't convex would it work?TIA
#6
Greg's explaination on how to add a collision shape and register it in your scene was right on the money, it is very easy to do and is clearly explained in the documentation. To add a few additional comments to this thread based on questions that were asked after Greg's great post...
Transparency:? No you do not need to make the collision object transparent. As the documentation explains, you have already flagged the object to be non-renderable by appending " -# " to the objects name. If you want to see through the collision shape in your viewport you can turn on the option "see through" on the collision object.
Does it need to Encompass my shape? it doesn't need to be an exact fit, an approximate fit is good enough.
Collision Shape? Your collision shape should be something very simple, probably around 16 faces or less unless you want to seriously hurt the performance of your TGE application. What the shape looks like is irrelivent because it needs to be a best fit for the model that it is acting as a collision for. The shape should not be concave or it will generate an error in TGE. If you have a L shape then you will need to use two collision shapes.
Bounds Object? The bounds object is not a collision object, they are two different things. You only have one bounds object in your scene (which is like a big container for your model and its transformation), but you can have multiple collision shapes if you like.
Logan
09/19/2002 (7:47 am)
Transparency:? No you do not need to make the collision object transparent. As the documentation explains, you have already flagged the object to be non-renderable by appending " -# " to the objects name. If you want to see through the collision shape in your viewport you can turn on the option "see through" on the collision object.
Does it need to Encompass my shape? it doesn't need to be an exact fit, an approximate fit is good enough.
Collision Shape? Your collision shape should be something very simple, probably around 16 faces or less unless you want to seriously hurt the performance of your TGE application. What the shape looks like is irrelivent because it needs to be a best fit for the model that it is acting as a collision for. The shape should not be concave or it will generate an error in TGE. If you have a L shape then you will need to use two collision shapes.
Bounds Object? The bounds object is not a collision object, they are two different things. You only have one bounds object in your scene (which is like a big container for your model and its transformation), but you can have multiple collision shapes if you like.
Logan
#7
Apparently I've confused a bounding box with a collision object. I will assume for now that you are correct, that the collision documentation is correct and very easy, at least when not trying to apply it to the thought of a bounding box. I guess I assumed that the two would be the same. My mistake. I'm really not that concerned with collision detection (the L shape was merely a curiosity question, and I'll have to deal with it later anyway), but rather just wanted to figure out how to make a bounding box to even export the 3ds models.
With that said, thank you for answering my questions and sorry for the trouble.
09/19/2002 (9:53 am)
Ok...sorry if I seem a little new here, but as you can tell by my previous post....well I am, or I wouldn't be asking these questions in the first place.Apparently I've confused a bounding box with a collision object. I will assume for now that you are correct, that the collision documentation is correct and very easy, at least when not trying to apply it to the thought of a bounding box. I guess I assumed that the two would be the same. My mistake. I'm really not that concerned with collision detection (the L shape was merely a curiosity question, and I'll have to deal with it later anyway), but rather just wanted to figure out how to make a bounding box to even export the 3ds models.
With that said, thank you for answering my questions and sorry for the trouble.
#8
09/19/2002 (4:45 pm)
Wow
#9
How would you put collision on player models? You want more detail than a box, but you can't have concave surfaces. If you try to make simple collision boxes for the limbs, you exceed the 9 you're alloted. (1 for head, 2 for left arm, 2 for right arm, 2 for left leg, 2 for right leg, 2 for feet, 1 for chest = 12).
Or can the Bipeds be used for collision detection since they are exported anyway?
09/27/2002 (2:50 pm)
Okay, I got one.How would you put collision on player models? You want more detail than a box, but you can't have concave surfaces. If you try to make simple collision boxes for the limbs, you exceed the 9 you're alloted. (1 for head, 2 for left arm, 2 for right arm, 2 for left leg, 2 for right leg, 2 for feet, 1 for chest = 12).
Or can the Bipeds be used for collision detection since they are exported anyway?
#10
If you wanted hit boxes though that might be another issue onto itself, but by default TGE handles the collision for the player characters.
Logan
09/28/2002 (8:41 am)
AFAIK you don't need to put any collision information onto the player character models because the engine does this internally.If you wanted hit boxes though that might be another issue onto itself, but by default TGE handles the collision for the player characters.
Logan
Torque 3D Owner Frank Bignone
Darkhand Studio