Removed useless GetCollisionRayMesh and libraylib.a
This commit is contained in:
parent
d003c23ecf
commit
d2cc5b88df
3 changed files with 0 additions and 44 deletions
Binary file not shown.
43
src/models.c
43
src/models.c
|
@ -1966,50 +1966,7 @@ bool CheckCollisionRayBox(Ray ray, BoundingBox box)
|
||||||
return collision;
|
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
|
// 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 GetCollisionRayModel(Ray ray, Model *model)
|
||||||
{
|
{
|
||||||
RayHitInfo result = { 0 };
|
RayHitInfo result = { 0 };
|
||||||
|
|
|
@ -1052,7 +1052,6 @@ RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphere
|
||||||
RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius,
|
RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius,
|
||||||
Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point
|
Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point
|
||||||
RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box
|
RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box
|
||||||
RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh); // Get collision info between ray and mesh
|
|
||||||
RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model *model); // Get collision info between ray and model
|
RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model *model); // Get collision info between ray and model
|
||||||
RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
||||||
RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane)
|
RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue