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

Method debugDrawBoundingBox

CryAnimation/CryModelState.cpp:1555–1587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1553}
1554
1555void CryModelState::debugDrawBoundingBox(const Matrix44* pModelMatrix, int nBBoxSegments)
1556{
1557 static const float fColorBBox[4] = {1,1,1,1};
1558
1559 if (!pModelMatrix)
1560 pModelMatrix = &m_ModelMatrix44;
1561
1562 // this draws the bounding box around the character
1563 Matrix34 m34=Matrix34(GetTransposed44(*pModelMatrix));
1564 debugDrawBBox (m34, m_BBox, nBBoxSegments, fColorBBox);
1565
1566 int nAxis[3];
1567 for (nAxis[0] = 0; nAxis[0] < 3; ++nAxis[0])
1568 {
1569 nAxis[1] = (nAxis[0]+1)%3;
1570 nAxis[2] = (nAxis[0]+2)%3;
1571 Vec3d vDown(0,0,0), vUp(0,0,0);
1572 vDown[nAxis[0]] = m_BBox.vMin[nAxis[0]];
1573 float fUp = m_BBox.vMax[nAxis[0]];
1574 vUp[nAxis[0]] = fUp+0.05f;
1575 float fColor[4] = {1,1,1,1};
1576 fColor[nAxis[1]] = fColor[nAxis[2]] = 0.75;
1577 debugDrawLine (*pModelMatrix, vDown, vUp, fColor);
1578 Vec3d vA;
1579 vA[nAxis[0]] = m_BBox.vMax[nAxis[0]]-0.025f;
1580 for (int i= 0; i < 4; ++i)
1581 {
1582 for (int j = 0; j < 2; ++j)
1583 vA[nAxis[j+1]] = (i&(1<<j))?0.025f:-0.025f;
1584 debugDrawLine (*pModelMatrix, vUp, vA, fColor);
1585 }
1586 }
1587}
1588
1589
1590

Callers 2

RenderMethod · 0.80
ExecScriptCommandMethod · 0.80

Calls 2

debugDrawBBoxFunction · 0.85
debugDrawLineFunction · 0.85

Tested by

no test coverage detected