summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorCarlos Hernandez Barbera <[email protected]>2021-03-27 18:24:39 +0100
committerGitHub <[email protected]>2021-03-27 18:24:39 +0100
commit7eaeffc8d9ddc1cee3b7cab44a519ddbc6931606 (patch)
tree3763264490a8267e6fbe1ef0aab3c8a6d92f628e /src
parentf38ced15e7c831e611edd8a125f48f929633733b (diff)
downloadraylib-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.c3
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++)