mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:02:55 +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) {
|
foreach (const FBXMesh& mesh, collisionGeometry.meshes) {
|
||||||
// each meshPart is a convex hull
|
// each meshPart is a convex hull
|
||||||
foreach (const FBXMeshPart &meshPart, mesh.parts) {
|
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
|
// run through all the triangles and (uniquely) add each point to the hull
|
||||||
unsigned int triangleCount = meshPart.triangleIndices.size() / 3;
|
unsigned int triangleCount = meshPart.triangleIndices.size() / 3;
|
||||||
|
@ -667,14 +668,10 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
||||||
|
|
||||||
if (pointsInPart.size() == 0) {
|
if (pointsInPart.size() == 0) {
|
||||||
qCDebug(entitiesrenderer) << "Warning -- meshPart has no faces";
|
qCDebug(entitiesrenderer) << "Warning -- meshPart has no faces";
|
||||||
|
points.pop_back();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
++i;
|
||||||
// add next convex hull
|
|
||||||
QVector<glm::vec3> newMeshPoints;
|
|
||||||
points << newMeshPoints;
|
|
||||||
// add points to the new convex hull
|
|
||||||
points[i++] << pointsInPart;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue