Game Development Community

Is LOScol not needed anymore?

by Steve Kilcollins · in Torque Game Engine · 07/31/2004 (12:01 pm) · 22 replies

On 7/3/04, Ben Garney put in to CVS:
Quote:
Change #: 383
Committed by: Ben Garney
Date: 2004/07/03 06:41:28

Description:

- A lot of miscellaneous 3space fixes, including some sanity checks/warnings It is now even more important to name your collision meshes properly, ie, with Col at the beginning.
- TSLastDetail is also vastly improved.

Modified Files:

torque/engine/ts/tsCollision.cc (2.3)
torque/engine/ts/tsLastDetail.cc (2.4)
torque/engine/ts/tsLastDetail.h (2.3)
torque/engine/ts/tsShape.cc (2.3)
torque/engine/ts/tsShapeInstance.cc (2.4)
torque/engine/ts/tsShapeInstance.h (2.4)

I was using a model (palm.dts that was availible in the resources somewhere) and it had a Col-1 (trunk), Col-2(leaves) and LOScol-9(trunk) LOScol-10(leaves) and when I ran my map, it was spitting out
Quote:
TSShapeInstance::buildPolyList - Collision mesh names must start with Col, encountered
in the buildploylist and in the castray functions in tsCollisions.

As a test, I took out the LOScol-9 & -10 and then exported the tree; I didn't get any messages AND I could shoot it with the crossbow as well as the crossbow bolt would blow up when it touched the tree.

So, I'm a little confused. In the docs, it says that col-1 is the collision geometry and LOSCol was line of sigh collisions--which were used for projectiles.

So am I correct in assuming that LOSCols are no longer needed? or if they are, then what are they used for?
Page«First 1 2 Next»
#21
06/20/2007 (2:36 am)
Quote:
I believe that the LOSCol is for ray cast checks and the Col is for convex collision checks. So in theory you can provide even simpler geometry for the LOSCol...

I understand the theory and I take it we're talking about LOScol-x. But I can nowhere ni the code find ANYTHING that says LOSCol. Can Someone care to explain?

On the other hand, I can find LOS.

So has LOS-x replaced LOScol-x?
#22
09/12/2007 (8:37 pm)
Apparently the simple answer is no, LOS has not replaced LOSCol. I just played with this for a few hours and this is what I've come up with:

Collision meshes need to be named "collision[X]" where X should be a negative integer in the range of -1 to -8. For example "collision-1"

In my experiments, the collision meshes stop working when the name is changed to col[X]. I'm not sure if earlier engines recognize this but as of v1.5.2 "col" does nothing. I suspect based on the "todo" from '04 a bit higher up (still not done), that nothing's changed for a while.

Collision meshes named "collision[X]" can also respond to projectiles (that *I think* use ray-casts) - but won't necessarily. It seems to depend on the geometry of the collision mesh. I'm finding that you can make a pretty form-fitting collision mesh that works great for player collisions (convex?) - so that you can run between the legs of a monster-spider and still have the legs be solid. However, projectiles seem to whiz right through the meshes if they get too small (or a host of other touchy issues).

Bringing us to LOSCol. LOS Collision meshes are named "LOSCol[X]" where X is a negative integer in the range of -9 to -16. For example "LOSCol-9". I'm pretty sure you can use any negative number, but why confuse yourself or anyone else?

As with the "col[X]" abbreviation, meshes named "LOS[X]" appear to do nothing. When I named my mesh "LOS-9" nothing happened, when I named it "LOSCol-9" projectiles hit it.

LOS Collision meshes only (seem to) respond to projectiles (and other objects that use the same ray-casts I assume) - so you can run through them, but not shoot through them. These need to be pretty simple and relatively large, or they seem to fail. Think simple blocks and cylinders (if they are big/simple enough). Generally, you are going to have to test the models.

It is important to note: a mesh that fails to register ray-cast events when named "collision[X]" will also fail when named "LOSCol[X]". The name itself does nothing in this regard. Likewise, a mesh named "LOSCol[X]" that responds to projectiles (ray-casts) will respond even if called "collision[X]" - then it will simply handle both types of events. The only reason you need both is if you want a complex mesh for player (convex) interaction that projectiles won't register.

So, in summary: name your mesh "collision[-X]". If the mesh is simple, that's all there is to it (shoot at it, if there is a hit - it's all good). If you have a resonably complicated collision mesh that fails to register ray-casts, make an additional SIMPLE mesh to grab these events and call it "LOSCol[-X]"

NOTE: I'm using Milkshape to model. The only way it's exporter supports collision meshes is by using named meshes - if there is some other way to do it with Blender (mentioned earlier above), I havn't a clue what it is.

{Disclaimer: I'm pretty clueless myself, so these are the results of my observations - not any direct knowledge of the engine per-se. If I find out I was wrong .... I'll update this post}
Page«First 1 2 Next»