Question about some back end .cc code
by Nancy Lee · in Technical Issues · 09/09/2008 (6:17 am) · 2 replies
The following code was taken from guiShapeNameHud.cc in the engine/game/fps folder .
I am quite confused about it. It seems to me it ignores anything that is mounted onto it, and keep displaying the shape base object name, but when I tried it out, it stop showing the name.
Can anybody tell me is there any way to fix it? and explain a little bit about the following code.
Thanks so much!
// Test to see if it's behind something, and we want to
// ignore anything it's mounted on when we run the LOS.
RayInfo info;
shape->disableCollision();
ShapeBase *mount = shape->getObjectMount();
if (mount)
mount->disableCollision();
bool los = !gClientContainer.castRay(camPos, shapePos,losMask, &info);
shape->enableCollision();
if (mount)
mount->enableCollision();
if (!los)
continue;
I am quite confused about it. It seems to me it ignores anything that is mounted onto it, and keep displaying the shape base object name, but when I tried it out, it stop showing the name.
Can anybody tell me is there any way to fix it? and explain a little bit about the following code.
Thanks so much!
// Test to see if it's behind something, and we want to
// ignore anything it's mounted on when we run the LOS.
RayInfo info;
shape->disableCollision();
ShapeBase *mount = shape->getObjectMount();
if (mount)
mount->disableCollision();
bool los = !gClientContainer.castRay(camPos, shapePos,losMask, &info);
shape->enableCollision();
if (mount)
mount->enableCollision();
if (!los)
continue;
About the author
Torque 3D Owner Ted Southard