summary refs log tree commit diff
path: root/src/Models.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Models.cpp')
-rw-r--r--src/Models.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Models.cpp b/src/Models.cpp
index acbbaa8..0e558e2 100644
--- a/src/Models.cpp
+++ b/src/Models.cpp
@@ -120,16 +120,15 @@ void Model::draw(float r, float g, float b)
 int Model::LineCheck(XYZ p1, XYZ p2, XYZ *p)
 {
 	int result = -1;
-	if (segmentIntersectsSphere(p1, p2, boundingspherecenter,
-	                            boundingsphereradius)) {
+	if (segCrossSphere(p1, p2, boundingspherecenter, boundingsphereradius)) {
 		float olddistance = 9999999.0;
 		for (int j = 0; j < TriangleNum; ++j) {
 			XYZ point;
-			if (!LineFacetd(p1, p2,
-			                vertex[Triangles[j].vertex[0]],
-			                vertex[Triangles[j].vertex[1]],
-			                vertex[Triangles[j].vertex[2]],
-			                normals[j], &point))
+			if (!segCrossTrigon(p1, p2,
+			                    vertex + Triangles[j].vertex[0],
+			                    vertex + Triangles[j].vertex[1],
+			                    vertex + Triangles[j].vertex[2],
+			                    normals + j, &point))
 				continue;
 			float distance = sqrlen(point - p1);
 			if (distance < olddistance || result == -1) {