| 946 | } |
| 947 | |
| 948 | int Object::GetProxyComplexity(int level, const FrameBase& pos, float dist2) const |
| 949 | { |
| 950 | int nFaces = 0; |
| 951 | |
| 952 | Shape* sShape = _shape->LevelOpaque(level); |
| 953 | |
| 954 | // calculate default proxies (included in shape) |
| 955 | for (int i = 0; i < sShape->NProxies(); i++) |
| 956 | { |
| 957 | const ProxyObject& proxy = sShape->Proxy(i); |
| 958 | |
| 959 | // smart clipping par of obj->Draw |
| 960 | Matrix4Val pTransform = pos.Transform() * proxy.obj->Transform(); |
| 961 | |
| 962 | // LOD detection |
| 963 | LODShapeWithShadow* pshape = proxy.obj->GetShapeOnPos(pTransform.Position()); |
| 964 | if (!pshape) |
| 965 | { |
| 966 | continue; |
| 967 | } |
| 968 | int level = GScene->LevelFromDistance2(pshape, dist2, pTransform.Scale(), pTransform.Direction(), |
| 969 | GScene->GetCamera()->Direction()); |
| 970 | if (level == LOD_INVISIBLE) |
| 971 | { |
| 972 | continue; |
| 973 | } |
| 974 | |
| 975 | Matrix4Val invPTransform = proxy.invTransform * pos.GetInvTransform(); |
| 976 | FrameWithInverse pFrame(pTransform, invPTransform); |
| 977 | |
| 978 | // construct FrameWithInverse from transform and invTransform |
| 979 | |
| 980 | nFaces += proxy.obj->GetComplexity(level, pFrame); |
| 981 | } |
| 982 | |
| 983 | return nFaces; |
| 984 | } |
| 985 | |
| 986 | int Object::GetComplexity(int level, const FrameBase& pos) const |
| 987 | { |
nothing calls this directly
no test coverage detected