MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / NoFogNeeded

Function NoFogNeeded

engine/Poseidon/World/Scene/Object.cpp:643–661  ·  view source on GitHub ↗

namespace Poseidon

Source from the content-addressed store, hash-verified

641
642} // namespace Poseidon
643bool NoFogNeeded(float dist2, const Shape* shape, float bRadius)
644{
645 using namespace Poseidon;
646 // determine pesimistic fog treshold
647 float minFog = GLOB_SCENE->GetFogMinRange();
648 ClipFlags andFog = shape->GetAndHints() & ClipFogMask;
649 ClipFlags orFog = shape->GetOrHints() & ClipFogMask;
650 if (andFog == ClipFogSky)
651 {
652 minFog = MinSkyFog;
653 }
654 if (orFog == ClipFogShadow)
655 {
656 minFog = GLOB_SCENE->GetShadowFogMinRange();
657 }
658 // check object coordinates
659 float minDist = floatMax(minFog - bRadius, 0);
660 return (dist2 < Square(minDist));
661}
662namespace Poseidon
663{
664

Callers 2

DrawMethod · 0.85
DrawShadowMethod · 0.85

Calls 6

floatMaxFunction · 0.85
GetFogMinRangeMethod · 0.80
GetShadowFogMinRangeMethod · 0.80
SquareFunction · 0.50
GetAndHintsMethod · 0.45
GetOrHintsMethod · 0.45

Tested by

no test coverage detected