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

Method GetComplexity

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

Source from the content-addressed store, hash-verified

984}
985
986int Object::GetComplexity(int level, const FrameBase& pos) const
987{
988 // preview draw with given level
989 // return number of faces
990 if (level == LOD_INVISIBLE)
991 {
992 return 0; // invisible LOD
993 }
994 LODShape* lshape = GetShapeOnPos(pos.Position());
995 if (!lshape)
996 {
997 return 0;
998 }
999 Shape* shape = lshape->Level(level);
1000 if (!shape)
1001 {
1002 return 0;
1003 }
1004 int nFaces = shape->NFaces();
1005 if (shape->NProxies() > 0)
1006 {
1007 float dist2 = GScene->GetCamera()->Position().Distance2(pos.Position());
1008 nFaces += GetProxyComplexity(level, pos, dist2);
1009 }
1010 return nFaces;
1011}
1012
1013void Object::DrawDecal(int forceLOD, ClipFlags clipFlags, const FrameBase& pos)
1014{

Callers 4

AdjustComplexityMethod · 0.80
GetProxyComplexityMethod · 0.80
GetProxyComplexityMethod · 0.80

Calls 8

GetShapeOnPosFunction · 0.85
GetProxyComplexityFunction · 0.85
LevelMethod · 0.80
NProxiesMethod · 0.80
GetCameraMethod · 0.80
PositionMethod · 0.45
NFacesMethod · 0.45
Distance2Method · 0.45

Tested by

no test coverage detected