Draw a concave mesh shape
| 348 | |
| 349 | // Draw a concave mesh shape |
| 350 | void DebugRenderer::drawConcaveMeshShape(const Transform& transform, const ConcaveMeshShape* concaveMeshShape, |
| 351 | uint32 colorShape, uint32 colorShapeNormals) { |
| 352 | |
| 353 | const bool drawShape = getIsDebugItemDisplayed(DebugItem::COLLISION_SHAPE); |
| 354 | const bool drawNormal = getIsDebugItemDisplayed(DebugItem::COLLISION_SHAPE_NORMAL); |
| 355 | |
| 356 | if (drawShape) { |
| 357 | |
| 358 | // For each triangle of the mesh |
| 359 | for (uint32 t = 0; t < concaveMeshShape->getNbTriangles(); t++) { |
| 360 | |
| 361 | Vector3 v1, v2, v3; |
| 362 | concaveMeshShape->getTriangleVertices(t, v1, v2, v3); |
| 363 | |
| 364 | v1 = transform * v1; |
| 365 | v2 = transform * v2; |
| 366 | v3 = transform * v3; |
| 367 | |
| 368 | mTriangles.add(DebugTriangle(v1, v2, v3, colorShape)); |
| 369 | } |
| 370 | } |
| 371 | |
| 372 | if (drawNormal) { |
| 373 | |
| 374 | // For each vertex of the mesh |
| 375 | for (uint32 v = 0; v < concaveMeshShape->getNbVertices(); v++) { |
| 376 | |
| 377 | const Vector3& vertex = transform * concaveMeshShape->getVertex(v); |
| 378 | const Vector3 normalPoint = vertex + transform.getOrientation() * concaveMeshShape->getVertexNormal(v) * mCollisionShapeNormalLength; |
| 379 | mLines.add(DebugLine(vertex, normalPoint, colorShapeNormals)); |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | // Draw a height field shape |
| 385 | void DebugRenderer::drawHeightFieldShape(const Transform& transform, const HeightFieldShape* heightFieldShape, |
nothing calls this directly
no test coverage detected