aboutsummaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorlumaio teon <lumaioteon@gmail.com>2018-04-07 03:49:56 -0400
committerlumaio teon <lumaioteon@gmail.com>2018-04-07 03:49:56 -0400
commitd2cc5b88dfa3ff8bbcd66a4849cd3be1d553b6f1 (patch)
tree1c2572933ac9337270b91df118bf22511cf43ede /src/models.c
parentd003c23ecf6ec22f4811d07cb30fd2c86cf1d190 (diff)
downloadraylib-d2cc5b88dfa3ff8bbcd66a4849cd3be1d553b6f1.tar.gz
raylib-d2cc5b88dfa3ff8bbcd66a4849cd3be1d553b6f1.zip
Removed useless GetCollisionRayMesh and libraylib.a
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/models.c b/src/models.c
index 0db46fc1..ccf2d05b 100644
--- a/src/models.c
+++ b/src/models.c
@@ -1966,50 +1966,7 @@ bool CheckCollisionRayBox(Ray ray, BoundingBox box)
return collision;
}
-// Get collision info between ray and mesh
-RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh)
-{
- RayHitInfo result = { 0 };
-
- // If mesh doesn't have vertex data on CPU, can't test it.
- if (!mesh->vertices) return result;
-
- // mesh->triangleCount may not be set, vertexCount is more reliable
- int triangleCount = mesh->vertexCount/3;
-
- // Test against all triangles in mesh
- for (int i = 0; i < triangleCount; i++)
- {
- Vector3 a, b, c;
- Vector3 *vertdata = (Vector3 *)mesh->vertices;
-
- if (mesh->indices)
- {
- a = vertdata[mesh->indices[i*3 + 0]];
- b = vertdata[mesh->indices[i*3 + 1]];
- c = vertdata[mesh->indices[i*3 + 2]];
- }
- else
- {
- a = vertdata[i*3 + 0];
- b = vertdata[i*3 + 1];
- c = vertdata[i*3 + 2];
- }
-
- RayHitInfo triHitInfo = GetCollisionRayTriangle(ray, a, b, c);
-
- if (triHitInfo.hit)
- {
- // Save the closest hit triangle
- if ((!result.hit) || (result.distance > triHitInfo.distance)) result = triHitInfo;
- }
- }
-
- return result;
-}
-
// Get collision info between ray and model
-// NOTE: This is an exact clone of GetCollisionRayMesh but applies transformation matrix from the model to the vertices
RayHitInfo GetCollisionRayModel(Ray ray, Model *model)
{
RayHitInfo result = { 0 };