Merge pull request #1033 from eightyeight/guishapenamehud-maths-fix

Fix GuiShapeNameHud maths
This commit is contained in:
Daniel Buckmaster 2014-12-12 21:45:14 +11:00
commit 38f8c79b3e

View file

@ -182,9 +182,9 @@ void GuiShapeNameHud::onRender( Point2I, const RectI &updateRect)
cam.getColumn(3, &camPos);
cam.getColumn(1, &camDir);
F32 camFov;
conn->getControlCameraFov(&camFov);
camFov = mDegToRad(camFov) / 2;
F32 camFovCos;
conn->getControlCameraFov(&camFovCos);
camFovCos = mCos(mDegToRad(camFovCos) / 2);
// Visible distance info & name fading
F32 visDistance = gClientSceneGraph->getVisibleDistance();
@ -236,7 +236,7 @@ void GuiShapeNameHud::onRender( Point2I, const RectI &updateRect)
// projection and box test.
shapeDir.normalize();
F32 dot = mDot(shapeDir, camDir);
if (dot < camFov)
if (dot < camFovCos)
continue;
// Test to see if it's behind something, and we want to