/////////////////////////////////////////////////////////////////////
| 668 | |
| 669 | ////////////////////////////////////////////////////////////////////////// |
| 670 | void 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 | } |
nothing calls this directly
no test coverage detected