/// \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; }
/// \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; }
/// \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; }