We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
scaling seems to be wrong in ConcaveMeshShape. Please see attached a patch:
diff --git a/ext/reactphysics3d/src/collision/shapes/ConcaveMeshShape.cpp b/ext/reactphysics3d/src/collision/shapes/ConcaveMeshShape.cpp index 79c431e0..4864e56d 100644 --- a/ext/reactphysics3d/src/collision/shapes/ConcaveMeshShape.cpp +++ b/ext/reactphysics3d/src/collision/shapes/ConcaveMeshShape.cpp @@ -64,9 +64,15 @@ void ConcaveMeshShape::initBVHTree() { triangleVertexArray->getTriangleVertices(triangleIndex, trianglePoints); // Apply the scaling factor to the vertices - trianglePoints[0] *= mScaling.x; - trianglePoints[1] *= mScaling.y; - trianglePoints[2] *= mScaling.z; + trianglePoints[0][0] *= mScaling.x; + trianglePoints[0][1] *= mScaling.y; + trianglePoints[0][2] *= mScaling.z; + trianglePoints[1][0] *= mScaling.x; + trianglePoints[1][1] *= mScaling.y; + trianglePoints[1][2] *= mScaling.z; + trianglePoints[2][0] *= mScaling.x; + trianglePoints[2][1] *= mScaling.y; + trianglePoints[2][2] *= mScaling.z; // Create the AABB for the triangle AABB aabb = AABB::createAABBForTriangle(trianglePoints); @@ -88,9 +94,15 @@ void ConcaveMeshShape::getTriangleVertices(uint subPart, uint triangleIndex, triangleVertexArray->getTriangleVertices(triangleIndex, outTriangleVertices); // Apply the scaling factor to the vertices - outTriangleVertices[0] *= mScaling.x; - outTriangleVertices[1] *= mScaling.y; - outTriangleVertices[2] *= mScaling.z; + outTriangleVertices[0][0] *= mScaling.x; + outTriangleVertices[0][1] *= mScaling.y; + outTriangleVertices[0][2] *= mScaling.z; + outTriangleVertices[1][0] *= mScaling.x; + outTriangleVertices[1][1] *= mScaling.y; + outTriangleVertices[1][2] *= mScaling.z; + outTriangleVertices[2][0] *= mScaling.x; + outTriangleVertices[2][1] *= mScaling.y; + outTriangleVertices[2][2] *= mScaling.z; } // Return the three vertex normals (in the array outVerticesNormals) of a triangle
Best regards Andreas
The text was updated successfully, but these errors were encountered:
Thanks a lot for reporting this. The issue is now fixed in the master branch.
Sorry, something went wrong.
DanielChappuis
No branches or pull requests
Hi,
scaling seems to be wrong in ConcaveMeshShape. Please see attached a patch:
Best regards
Andreas
The text was updated successfully, but these errors were encountered: