Game Development Community

Container Raycast problem

by Richard Marrevee · in Torque 3D Professional · 03/29/2011 (12:34 pm) · 0 replies

I have a closed chest (StaticShape) and inside this chest is another smaller chest (also StaticShape). Now when I am performing a raycast there are some points at which the raycast returns the inside chest. Now when I set all meshes hidden on the inside chest, the raycast returns the outer chest.

Somehow I got the impression that the raycast returns the first object (closest) hit, but that is not happening in this case.

Due to the shape of the chest the model contains more than 1 Col meshes. First I named them Col-1 to Col-5 and later I have named them ColA-1 to ColD-1, but that gives no relief :(. The meshes are pretty thin,but that should not be a problem imho.

Anyone who could point me to a "simple" solution, before I try zoning every chest or try to build some sort of container class?

It seems that this also happens with Items inside.

Edit:
SetAllMeshesHidden seem to work only Client-side, SetCloaked on the server-object doesn't seem to work in client or server-side.

Thanks

About the author

Started programming in 1984 on an Oric, when time progressed switched to MSX, Amiga and finally the Windows PC with T3D. Now developing an epic fantasy game: The Master's Eye. Creator of the DoorClass pack and VolumetricFog pack @ richardsgamestudio.com