| 104 | } |
| 105 | |
| 106 | void LocalCollisionTriangle::DrawDebug(const Matrix& transformMatrix, const Matrix& rotMatrix, const std::vector<Vector3>& vertices) const |
| 107 | { |
| 108 | constexpr auto TRI_SURF_COLOR = Color(1.0f, 1.0f, 0.0f, 0.1f); |
| 109 | constexpr auto TRI_OUTLINE_COLOR = Color(1.0f, 1.0f, 1.0f, 0.25f); |
| 110 | constexpr auto NORMAL_LENGTH = BLOCK(0.2f); |
| 111 | constexpr auto NORMAL_COLOR = Color(1.0f, 1.0f, 1.0f); |
| 112 | |
| 113 | // Get vertices. |
| 114 | auto vertex0 = Vector3::Transform(GetVertex0(vertices), transformMatrix); |
| 115 | auto vertex1 = Vector3::Transform(GetVertex1(vertices), transformMatrix); |
| 116 | auto vertex2 = Vector3::Transform(GetVertex2(vertices), transformMatrix); |
| 117 | |
| 118 | // Get normal. |
| 119 | auto normal = Vector3::Transform(GetNormal(vertices), rotMatrix); |
| 120 | |
| 121 | // Draw triangle surface. |
| 122 | DrawDebugTriangle(vertex0, vertex1, vertex2, TRI_SURF_COLOR); |
| 123 | |
| 124 | // Draw triangle outline. |
| 125 | DrawDebugLine(vertex0, vertex1, TRI_OUTLINE_COLOR); |
| 126 | DrawDebugLine(vertex1, vertex2, TRI_OUTLINE_COLOR); |
| 127 | DrawDebugLine(vertex2, vertex0, TRI_OUTLINE_COLOR); |
| 128 | |
| 129 | // Draw triangle normal. |
| 130 | auto center = (vertex0 + vertex1 + vertex2) / VERTEX_COUNT; |
| 131 | DrawDebugLine(center, Geometry::TranslatePoint(center, normal, NORMAL_LENGTH), NORMAL_COLOR); |
| 132 | } |
| 133 | |
| 134 | CollisionMesh::CollisionMesh(const Vector3& pos, const Quaternion& orient, const CollisionMeshDesc& desc) |
| 135 | { |
nothing calls this directly
no test coverage detected