mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-19 09:48:15 +00:00
GetCollisionRayMesh makes use of triangle count (#1688)
Co-authored-by: Carlos Hernandez Barbera <carloshdezbarbera@gmail.com>
This commit is contained in:

committed by
GitHub

parent
f38ced15e7
commit
7eaeffc8d9
@@ -2987,8 +2987,7 @@ RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform)
|
|||||||
// Check if mesh vertex data on CPU for testing
|
// Check if mesh vertex data on CPU for testing
|
||||||
if (mesh.vertices != NULL)
|
if (mesh.vertices != NULL)
|
||||||
{
|
{
|
||||||
// model->mesh.triangleCount may not be set, vertexCount is more reliable
|
int triangleCount = mesh.triangleCount;
|
||||||
int triangleCount = mesh.vertexCount / 3;
|
|
||||||
|
|
||||||
// Test against all triangles in mesh
|
// Test against all triangles in mesh
|
||||||
for (int i = 0; i < triangleCount; i++)
|
for (int i = 0; i < triangleCount; i++)
|
||||||
|
Reference in New Issue
Block a user