void BuildBBs(const std::vector<const JRTTriangle*>& rTris, std::vector<TriangleBB>& rBBs)
{


    for (UINT i = 0; i < rTris.size(); i++)
    {
        TriangleBB curr;
        curr.pTri = rTris[i];

        Vec3f verts[3];
        verts[0] = rTris[i]->GetV1();
        verts[1] = rTris[i]->GetV2();
        verts[2] = rTris[i]->GetV3();
        curr.box = JRTBoundingBox((const float*)&verts[0], 3);
        curr.nIndex = i;

        rBBs.push_back(curr);
    }
}
Пример #2
0
JRTBoundingBox JRTMesh::ComputeBoundingBox() const
{
    return JRTBoundingBox((const float*)this->m_Positions.data (), m_nVertexCount);
}