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

Method GetProxyComplexity

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

Source from the content-addressed store, hash-verified

946}
947
948int 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
986int Object::GetComplexity(int level, const FrameBase& pos) const
987{

Callers

nothing calls this directly

Calls 12

LevelOpaqueMethod · 0.80
NProxiesMethod · 0.80
ProxyMethod · 0.80
LevelFromDistance2Method · 0.80
GetCameraMethod · 0.80
GetComplexityMethod · 0.80
TransformMethod · 0.45
GetShapeOnPosMethod · 0.45
PositionMethod · 0.45
ScaleMethod · 0.45
DirectionMethod · 0.45
GetInvTransformMethod · 0.45

Tested by

no test coverage detected