mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 12:28:51 +02:00
build compound sub meshes shapes with less copying
This commit is contained in:
parent
bce8879d7c
commit
eff59d3fd3
1 changed files with 4 additions and 7 deletions
|
@ -617,7 +617,8 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
|||
foreach (const FBXMesh& mesh, collisionGeometry.meshes) {
|
||||
// each meshPart is a convex hull
|
||||
foreach (const FBXMeshPart &meshPart, mesh.parts) {
|
||||
QVector<glm::vec3> pointsInPart;
|
||||
points.push_back(QVector<glm::vec3>());
|
||||
QVector<glm::vec3>& pointsInPart = points[i];
|
||||
|
||||
// run through all the triangles and (uniquely) add each point to the hull
|
||||
unsigned int triangleCount = meshPart.triangleIndices.size() / 3;
|
||||
|
@ -667,14 +668,10 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
|||
|
||||
if (pointsInPart.size() == 0) {
|
||||
qCDebug(entitiesrenderer) << "Warning -- meshPart has no faces";
|
||||
points.pop_back();
|
||||
continue;
|
||||
}
|
||||
|
||||
// add next convex hull
|
||||
QVector<glm::vec3> newMeshPoints;
|
||||
points << newMeshPoints;
|
||||
// add points to the new convex hull
|
||||
points[i++] << pointsInPart;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue