MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / DrawBoundObjects

Method DrawBoundObjects

CryAnimation/AnimObject.cpp:670–716  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

668
669//////////////////////////////////////////////////////////////////////////
670void CAnimObject::DrawBoundObjects(const SRendParams & rRendParams, Matrix44 &inmatTranRotMatrix, int nLOD)
671{
672 static const float fColorBBoxAttached[4] = {0.5,1,1,0.75};
673
674 if (g_GetCVars()->ca_NoDrawBound())
675 return;
676
677 if (m_arrBinds.empty())
678 return;
679
680 Matrix44 matAttachedObjectMatrix;
681 SRendParams rParams (rRendParams);
682 // this is required to avoid the attachments using the parent character material (this is the material that overrides the default material in the attachment)
683 rParams.pMaterial = NULL;
684
685 if (m_nFlags & CS_FLAG_DRAW_NEAR)
686 {
687 rParams.dwFObjFlags |= FOB_NEAREST;
688 }
689
690 BindArray::iterator it, itEnd = m_arrBinds.end();
691 for (it = m_arrBinds.begin(); it != itEnd; ++it)
692 {
693 IBindable* pBoundObject = (*it)->pObj;
694 if (!pBoundObject)
695 continue;
696
697 int nBone = (*it)->nBone;
698 if (nBone < 0 || nBone >= (int)m_nodes.size())
699 continue;
700
701 Matrix44 &boneTM = GetNodeMatrix(m_nodes[nBone]);
702 matAttachedObjectMatrix = boneTM * inmatTranRotMatrix;
703 rParams.pMatrix = &matAttachedObjectMatrix;
704
705 if (g_GetCVars()->ca_DrawBBox()>1){
706 Matrix34 m34=Matrix34(GetTransposed44(matAttachedObjectMatrix));
707
708 CryAABB caabb;
709 pBoundObject->GetBBox(caabb.vMin, caabb.vMax);
710
711 debugDrawBBox (m34, caabb, g_GetCVars()->ca_DrawBBox()-1,fColorBBoxAttached);
712 }
713 //pBoundObject->SetShaderTemplate( rParams.nShaderTemplate, 0] ,0 );
714 pBoundObject->Render(rParams,Vec3(zero), nLOD);
715 }
716}

Callers

nothing calls this directly

Calls 8

g_GetCVarsFunction · 0.85
debugDrawBBoxFunction · 0.85
emptyMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
GetBBoxMethod · 0.45
RenderMethod · 0.45

Tested by

no test coverage detected