mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-21 15:43:45 +00:00
Compare to cosine of angle, not angle.
This commit is contained in:
parent
27252b0864
commit
93fdcdecbe
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue