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

Function CoveredArea

engine/Poseidon/World/Scene/SceneDraw.cpp:943–961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

941 avgComplexity *= 1.0f / NStoreComplexities;
942}
943float Scene::GetSmokeGeneralization() const
944{
945 return _lodInvWidth * 0.1f;
946}
947
948#else
949
950static inline float CoveredArea(Object* obj, float dist2, float oScale)
951{
952 LODShape* shape = obj->GetShape();
953 if (!shape)
954 return 0;
955 float radius = shape->BoundingSphere() * oScale;
956
957 Camera* cam = GScene->GetCamera();
958 // return area in pixels
959 float areaK = cam->InvLeft() * cam->InvTop() * GEngine->Width() * GEngine->Height();
960
961 const float maxArea = 0.5f;
962 // if (Square(radius)/dist2>maxArea)
963 if (Square(radius) > dist2 * maxArea)
964 {

Callers 2

CmpCoveredAreaObjFunction · 0.85
AdjustComplexityMethod · 0.85

Calls 8

GetCameraMethod · 0.80
InvLeftMethod · 0.80
InvTopMethod · 0.80
SquareFunction · 0.50
GetShapeMethod · 0.45
BoundingSphereMethod · 0.45
WidthMethod · 0.45
HeightMethod · 0.45

Tested by

no test coverage detected