コード例 #1
0
ファイル: TriMesh.cpp プロジェクト: carussell/nvvg
/// \param m Specifies the transformation matrix to be applied.
/// \return The bounding box for the mesh under m.
AABB3 TriMesh::getBoundingBox(const Matrix4x3 &m) const
{
  AABB3 bb;
  bb.empty();
  for (int i = 0; i < vertexCount; ++i)
    bb.add(vertexList[i].p * m);
  return bb;
}
コード例 #2
0
/// \param m Specifies the transformation matrix applied to the model.
/// \return The bounding box of the model in transformed space.
AABB3 Model::getBoundingBox(const Matrix4x3 &m) const
{
    AABB3 bb;
    bb.empty();
    for(int i = 0; i < m_partCount; ++i)
        bb.add(m_partMeshList[i].getBoundingBox(m));
    return bb;
}
コード例 #3
0
/// \param submodel Specifies the submodel whose bounding box is to be fetched.
/// \param m Specifies the transformation matrix representing the submodel in world space.
AABB3 ArticulatedModel::getSubmodelBoundingBox(int submodel, const Matrix4x3 &m) const
{
  assert(submodel < m_nSubmodelCount);
  AABB3 bb;
  bb.empty();
  for(int i = 0; i < m_nNextSubmodelPart[submodel]; ++i)
    bb.add(m_partMeshList[m_nSubmodelPart[submodel][i]].getBoundingBox(m));
  return bb;
}