| 986 | return -1; |
| 987 | return CmpShapeObj(p1, p0); |
| 988 | } |
| 989 | |
| 990 | static inline int Complexity(LODShape* lShape, int level) |
| 991 | { |
| 992 | return lShape->Level(level)->NFaces(); |
| 993 | } |
| 994 | |
| 995 | static int FindLevelWithComplexity(LODShape* lShape, float complexity, float maxDif) |
| 996 | { |
| 997 | PoseidonAssert(complexity >= 0); |
| 998 | int bestI = -1; |
| 999 | float bestDif = maxDif; |
| 1000 | for (int i = 0; i < lShape->NLevels(); i++) |
| 1001 | { |
| 1002 | float resol = lShape->Resolution(i); |
| 1003 | if (resol > 900) |
| 1004 | break; |
| 1005 | int lComplex = Complexity(lShape, i); |
| 1006 | float dif = fabs(complexity - lComplex); |
| 1007 | if (bestDif > dif) |
| 1008 | { |
| 1009 | bestDif = dif; |
| 1010 | bestI = i; |
no test coverage detected