Problem with collision mesh
by Jeff Murray · in Technical Issues · 11/30/2006 (7:46 am) · 3 replies
Hi fellow Torquers!
I'm having some odd troubles with a mesh. Basically, it's a damageable (is that a word?) target for a target practice game. The player can shoot it, it explodes. The code is very simple and the datablock just points to the shape, but for some reason the collision box shows up in the game as a transparent black outline.
If I add the shape through the static shapes (ie. not through my custom category) it works fine .. adding this way makes a TSStatic and I guess the other is a StaticShape.
Here's a screenshot of whats going on ... www.psychicparrot.com/img/collisiongraphicbug.jpg
Anyone got any clues?? I've tried it with some other models and it still renders the collision mesh as a transparent shape... :S
Thanks in advance!
I'm having some odd troubles with a mesh. Basically, it's a damageable (is that a word?) target for a target practice game. The player can shoot it, it explodes. The code is very simple and the datablock just points to the shape, but for some reason the collision box shows up in the game as a transparent black outline.
If I add the shape through the static shapes (ie. not through my custom category) it works fine .. adding this way makes a TSStatic and I guess the other is a StaticShape.
Here's a screenshot of whats going on ... www.psychicparrot.com/img/collisiongraphicbug.jpg
Anyone got any clues?? I've tried it with some other models and it still renders the collision mesh as a transparent shape... :S
Thanks in advance!
#2
I looked at it, testing different models and such ... hours of headbanging, then it turned out that because I'd enabled shadow casting on staticObjects it was making wierd shadows on the collision mesh!
So in shadow.cc I had:
U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType | staticObjectType;
which was nice because shadows got cast all over the place ... but ... I had to change it back to
U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType;
to get rid of this weird collision mesh display problem.
Ah well ... we learn new stuff every day!!
Thanks again,
Jeff.
12/05/2006 (6:56 am)
Thanks for the reply James,I looked at it, testing different models and such ... hours of headbanging, then it turned out that because I'd enabled shadow casting on staticObjects it was making wierd shadows on the collision mesh!
So in shadow.cc I had:
U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType | staticObjectType;
which was nice because shadows got cast all over the place ... but ... I had to change it back to
U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType;
to get rid of this weird collision mesh display problem.
Ah well ... we learn new stuff every day!!
Thanks again,
Jeff.
#3
12/05/2006 (7:28 am)
If you are needing collision ONLY for gun bullets, you may wish to use a LOS collision mesh. They are not rendered, shadows will not stick to them, they player can pass right threw them- BUT they stop bullets. Do a search for LOS I know the TDN have info about it..
Torque Owner James Terry
Did you maybe set a texture or something on it in your model editor?