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

Method DrawProxies

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

Source from the content-addressed store, hash-verified

795}
796
797void Object::DrawProxies(int level, ClipFlags clipFlags, const Matrix4& transform, const Matrix4& invTransform,
798 float dist2, float z2, const LightList& lights)
799{
800 Shape* sShape = _shape->LevelOpaque(level);
801
802 // draw all proxy objects
803 for (int i = 0; i < sShape->NProxies(); i++)
804 {
805 const ProxyObject& proxy = sShape->Proxy(i);
806
807 // smart clipping par of obj->Draw
808 Matrix4Val pTransform = transform * proxy.obj->Transform();
809 Matrix4Val invPTransform = proxy.invTransform * invTransform;
810
811 // LOD detection
812 LODShapeWithShadow* pshape = proxy.obj->GetShapeOnPos(pTransform.Position());
813 if (!pshape)
814 {
815 continue;
816 }
817 int level = GScene->LevelFromDistance2(pshape, dist2, pTransform.Scale(), pTransform.Direction(),
818 GScene->GetCamera()->Direction());
819 if (level == LOD_INVISIBLE)
820 {
821 continue;
822 }
823
824 FrameWithInverse pFrame(pTransform, invPTransform);
825
826 // construct FrameWithInverse from transform and invTransform
827
828 proxy.obj->Draw(level, ClipAll, pFrame);
829 }
830}
831
832// pos is used mainly for proper proxy object positioning. This is the main function
833// used for object rendering. Default implementation performs Object::Animate before and

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected