Fix issue with scaling in ConcaveMeshShape
This commit is contained in:
parent
4678292b82
commit
fe02f4ecc5
|
@ -64,9 +64,15 @@ void ConcaveMeshShape::initBVHTree() {
|
||||||
triangleVertexArray->getTriangleVertices(triangleIndex, trianglePoints);
|
triangleVertexArray->getTriangleVertices(triangleIndex, trianglePoints);
|
||||||
|
|
||||||
// Apply the scaling factor to the vertices
|
// Apply the scaling factor to the vertices
|
||||||
trianglePoints[0] *= mScaling.x;
|
trianglePoints[0].x *= mScaling.x;
|
||||||
trianglePoints[1] *= mScaling.y;
|
trianglePoints[0].y *= mScaling.y;
|
||||||
trianglePoints[2] *= mScaling.z;
|
trianglePoints[0].z *= mScaling.z;
|
||||||
|
trianglePoints[1].x *= mScaling.x;
|
||||||
|
trianglePoints[1].y *= mScaling.y;
|
||||||
|
trianglePoints[1].z *= mScaling.z;
|
||||||
|
trianglePoints[2].x *= mScaling.x;
|
||||||
|
trianglePoints[2].y *= mScaling.y;
|
||||||
|
trianglePoints[2].z *= mScaling.z;
|
||||||
|
|
||||||
// Create the AABB for the triangle
|
// Create the AABB for the triangle
|
||||||
AABB aabb = AABB::createAABBForTriangle(trianglePoints);
|
AABB aabb = AABB::createAABBForTriangle(trianglePoints);
|
||||||
|
@ -88,9 +94,15 @@ void ConcaveMeshShape::getTriangleVertices(uint subPart, uint triangleIndex,
|
||||||
triangleVertexArray->getTriangleVertices(triangleIndex, outTriangleVertices);
|
triangleVertexArray->getTriangleVertices(triangleIndex, outTriangleVertices);
|
||||||
|
|
||||||
// Apply the scaling factor to the vertices
|
// Apply the scaling factor to the vertices
|
||||||
outTriangleVertices[0] *= mScaling.x;
|
outTriangleVertices[0].x *= mScaling.x;
|
||||||
outTriangleVertices[1] *= mScaling.y;
|
outTriangleVertices[0].y *= mScaling.y;
|
||||||
outTriangleVertices[2] *= mScaling.z;
|
outTriangleVertices[0].z *= mScaling.z;
|
||||||
|
outTriangleVertices[1].x *= mScaling.x;
|
||||||
|
outTriangleVertices[1].y *= mScaling.y;
|
||||||
|
outTriangleVertices[1].z *= mScaling.z;
|
||||||
|
outTriangleVertices[2].x *= mScaling.x;
|
||||||
|
outTriangleVertices[2].y *= mScaling.y;
|
||||||
|
outTriangleVertices[2].z *= mScaling.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the three vertex normals (in the array outVerticesNormals) of a triangle
|
// Return the three vertex normals (in the array outVerticesNormals) of a triangle
|
||||||
|
|
Loading…
Reference in New Issue
Block a user