diff options
| author | Carlos Hernandez Barbera <[email protected]> | 2021-03-27 18:24:39 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-27 18:24:39 +0100 |
| commit | 7eaeffc8d9ddc1cee3b7cab44a519ddbc6931606 (patch) | |
| tree | 3763264490a8267e6fbe1ef0aab3c8a6d92f628e /src | |
| parent | f38ced15e7c831e611edd8a125f48f929633733b (diff) | |
| download | raylib-7eaeffc8d9ddc1cee3b7cab44a519ddbc6931606.tar.gz raylib-7eaeffc8d9ddc1cee3b7cab44a519ddbc6931606.zip | |
GetCollisionRayMesh makes use of triangle count (#1688)
Co-authored-by: Carlos Hernandez Barbera <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/models.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c index 09a2b2f0..c49be3b9 100644 --- a/src/models.c +++ b/src/models.c @@ -2987,8 +2987,7 @@ RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform) // Check if mesh vertex data on CPU for testing if (mesh.vertices != NULL) { - // model->mesh.triangleCount may not be set, vertexCount is more reliable - int triangleCount = mesh.vertexCount / 3; + int triangleCount = mesh.triangleCount; // Test against all triangles in mesh for (int i = 0; i < triangleCount; i++) |
