Game Development Community

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;

#1
09/09/2008 (9:51 am)
Nancy, this should be discussed in the private forums, as it discusses code. You're much more likely to get answers there.
#2
09/09/2008 (8:43 pm)
Thanks a lot! Ted, will try it