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:
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
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?
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:in the buildploylist and in the castray functions in tsCollisions.
TSShapeInstance::buildPolyList - Collision mesh names must start with Col, encountered
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?
#2
07/31/2004 (1:16 pm)
This was a mistake. I am fixing now. Many apologies!
#3
07/31/2004 (4:55 pm)
Ok, almost have it redone...
#4
The idea is to catch if people have misplaced meshes.
07/31/2004 (5:05 pm)
Ok, it's checked in. Please pull a copy of HEAD and let me know if it's all working properly for you. Any error reporting should happen once, when the shape loads, and basically tell you if you have a non Col or LOSCol mesh in your collision info.The idea is to catch if people have misplaced meshes.
#5
07/31/2004 (5:06 pm)
Sorry about all the trouble. :)
#7
I tested this change,
1st test:
Had Collision-1,Collision-2, Col-1, Col-2, and I could not run through the tree (good) and projectiles would not go through the tree, in fact blew up. LOS was not in the export.
2st test:
Collision-1, Collision-2 under base01. Under start01 I renamed the Col-1 & 1 to colmy-1 and colmy-2, I did not have any LOSCol. I did not get the error message and the collisions worked. I could not go through the tree and the projectile blew up when it touched the tree.
3nd test:
I renamed Collision-1, Collision-2 to LOS-9 and LOS-10. I renamed Col-1 and Col-2 to LOSCol-9 and LOSCol-10. The tree had no collisions, I could run through the tree, and the projectiles would shoot through the tree.
4rd test:
I thought maybe the doc was backword so I renamed Collision-1, Collision-2 to LOSCol-9 and LOS-10 and Col-1, Col-2 to LOS-9, LOS-10. Same thing as test 2.
5th test:
Removed Col's and LOS's and Collisions/LOSCols. Everything passes through, and no error message (I didn't expect one).
6th test:
Put LOS-9, LOS-10, LOSCol-9, LOSCol-10 under base01
no error reported
7th test:
Put LOS-9, LOS-10, LOSCol-9, LOSCol-10 under start01
no error reported
Didn't appear LOS had any use.. and I couldn't get an error message to pop up when adding, or leaving it in the mission, saving the mission, then loading the mission.
Just so I'm correct in my thoughts.
Collision-1 and Col-1
Player would NOT pass through tree
Projectiles would pass through tree
LOS-9 and LOSCol-9
Player would pass through tree
Projectiles would NOT pass through tree
Collision-1, Col-1 and LOS-9, LOSCol-9
Player would NOT pass through tree
Projectiles would NOT pass through tree.
Is this the way it is supposed to be?
08/01/2004 (10:01 am)
I CVS'd the head, applied the 3 files that changed, recompiled.I tested this change,
1st test:
Had Collision-1,Collision-2, Col-1, Col-2, and I could not run through the tree (good) and projectiles would not go through the tree, in fact blew up. LOS was not in the export.
2st test:
Collision-1, Collision-2 under base01. Under start01 I renamed the Col-1 & 1 to colmy-1 and colmy-2, I did not have any LOSCol. I did not get the error message and the collisions worked. I could not go through the tree and the projectile blew up when it touched the tree.
3nd test:
I renamed Collision-1, Collision-2 to LOS-9 and LOS-10. I renamed Col-1 and Col-2 to LOSCol-9 and LOSCol-10. The tree had no collisions, I could run through the tree, and the projectiles would shoot through the tree.
4rd test:
I thought maybe the doc was backword so I renamed Collision-1, Collision-2 to LOSCol-9 and LOS-10 and Col-1, Col-2 to LOS-9, LOS-10. Same thing as test 2.
5th test:
Removed Col's and LOS's and Collisions/LOSCols. Everything passes through, and no error message (I didn't expect one).
6th test:
Put LOS-9, LOS-10, LOSCol-9, LOSCol-10 under base01
no error reported
7th test:
Put LOS-9, LOS-10, LOSCol-9, LOSCol-10 under start01
no error reported
Didn't appear LOS had any use.. and I couldn't get an error message to pop up when adding, or leaving it in the mission, saving the mission, then loading the mission.
Just so I'm correct in my thoughts.
Collision-1 and Col-1
Player would NOT pass through tree
Projectiles would pass through tree
LOS-9 and LOSCol-9
Player would pass through tree
Projectiles would NOT pass through tree
Collision-1, Col-1 and LOS-9, LOSCol-9
Player would NOT pass through tree
Projectiles would NOT pass through tree.
Is this the way it is supposed to be?
#8
08/01/2004 (10:27 am)
...
#9
There is no hard name requirement in the engine anymore. I added these checks because people were occasionally putting full meshes in their collision data, and I wanted people to be aware that something that didn't match the naming convention had snuck in. Up till now the engine would not tell you you had a potential problem - just sit there and go really slowly.
My first pass, using code from Matt Fairfax, would spam the console unmercifully AND drop those misnamed complexity collision meshes. That was clearly not the best solution. :) This new approach just prints out an error at load time. The name checking is very simple - just looks for Col or LOSCol as a prefix.
The idea is not to limit how you can structure your DTS shapes, but to make it easier to tell if you're shooting yourself in the foot.
Trust me, if we were going to intentionally change engine behavior, we'd be sure to let you know in some detail. This fix was intended to be an aid to good modelling, not a new hurdle! My apologies it didn't work out better. :)
Anyway, the behavior now should be that it yells at you if you have stuff in collision details that doesn't start with "Col" or "LOSCol". It should never drop collision details because of a misnamed mesh. Of course, if you put a collision mesh in the wrong place it won't be used for collision.
Hope this clears things up! If it's still not acting right, and you have a FRESH copy of HEAD and you've done a full rebuild on it, please let me know and I'll fix it as soon as I can.
Thanks,
Ben
08/01/2004 (11:37 am)
Hey guys,There is no hard name requirement in the engine anymore. I added these checks because people were occasionally putting full meshes in their collision data, and I wanted people to be aware that something that didn't match the naming convention had snuck in. Up till now the engine would not tell you you had a potential problem - just sit there and go really slowly.
My first pass, using code from Matt Fairfax, would spam the console unmercifully AND drop those misnamed complexity collision meshes. That was clearly not the best solution. :) This new approach just prints out an error at load time. The name checking is very simple - just looks for Col or LOSCol as a prefix.
The idea is not to limit how you can structure your DTS shapes, but to make it easier to tell if you're shooting yourself in the foot.
Trust me, if we were going to intentionally change engine behavior, we'd be sure to let you know in some detail. This fix was intended to be an aid to good modelling, not a new hurdle! My apologies it didn't work out better. :)
Anyway, the behavior now should be that it yells at you if you have stuff in collision details that doesn't start with "Col" or "LOSCol". It should never drop collision details because of a misnamed mesh. Of course, if you put a collision mesh in the wrong place it won't be used for collision.
Hope this clears things up! If it's still not acting right, and you have a FRESH copy of HEAD and you've done a full rebuild on it, please let me know and I'll fix it as soon as I can.
Thanks,
Ben
#10
08/01/2004 (3:47 pm)
...
#11
May I get a clarification of the LOSCol? or is my definiation correct in my previous post,
if it is correct;
1) any idea why projectiles go through when I have a LOSCol defined and no Col defined?
2) why when I have a Col defined and no LOSCol defined the projectiles collide?
That's where my confusion is.
08/01/2004 (7:47 pm)
Hey Ben. thanks again. I didn't mean to upset ya (if you are) I was (and still am) confused on what the LOSCol is used for. The message spaming is what made me take a look.May I get a clarification of the LOSCol? or is my definiation correct in my previous post,
if it is correct;
1) any idea why projectiles go through when I have a LOSCol defined and no Col defined?
2) why when I have a Col defined and no LOSCol defined the projectiles collide?
That's where my confusion is.
#12
08/01/2004 (9:51 pm)
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...
#13
08/02/2004 (5:17 am)
Thanks Ben for clearing that up for me.
#14
08/08/2004 (4:44 pm)
...
#17
08/11/2004 (9:37 pm)
...
#18
Thanks for the clue. That will make my life easier. :)
Will try to get to this soon.
08/12/2004 (8:27 am)
Ahhhh.... Duh!Thanks for the clue. That will make my life easier. :)
Will try to get to this soon.
#19
And, btw, I have a question.
I have a weapon with bones set up to perform some animation.
Two materials (one normal and second - ifl), one animation (named together with ifl).
Skinned mesh (not connected to anything), two "Bone" objects (connected to start01), col-1, LOScol-9 - both on start01 and Collision-1 and LOS-9 on base01.
When I use this item in game I got a console spam that boneA and boneB are collision meshes and should start with Col/LOSCol. Huh?
What's wrong with it? It works as usual - no errors in ShowToolPro, works in game too.. but in game it gives this error message in console.
I'm using ProExporters on 3dsmax8 with TGE1.5 btw.
05/28/2007 (6:12 pm)
Bump.// Yell at them if they named something!
if (dStrnicmp(mShape->names[mesh->object->nameIndex], "Col", 3) != 0 && dStrnicmp(mShape->names[mesh->object->nameIndex], "LOSCol", 3) != 0)
{
Con::errorf("%s.dts - Collision mesh names should start with Col or LOSCol, encountered '%s' in detail level %d", [b]mShape->mSourceResource->path[/b],mShape->names[mesh->object->nameIndex], dl);
continue;
}The same code is still there.And, btw, I have a question.
I have a weapon with bones set up to perform some animation.
Two materials (one normal and second - ifl), one animation (named together with ifl).
Skinned mesh (not connected to anything), two "Bone" objects (connected to start01), col-1, LOScol-9 - both on start01 and Collision-1 and LOS-9 on base01.
When I use this item in game I got a console spam that boneA and boneB are collision meshes and should start with Col/LOSCol. Huh?
What's wrong with it? It works as usual - no errors in ShowToolPro, works in game too.. but in game it gives this error message in console.
I'm using ProExporters on 3dsmax8 with TGE1.5 btw.
#20
05/28/2007 (11:23 pm)
.
Torque Owner Westy