diff options
author | Nguyễn Gia Phong <cnx@loang.net> | 2023-08-24 04:21:46 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <cnx@loang.net> | 2023-08-24 04:30:20 +0900 |
commit | efd25d51cdd7a9cadda1c0f6983905fc17545f14 (patch) | |
tree | 8dea973669d8dfe4e7209c9f419bf8cbbf483323 /src/Models.cpp | |
parent | 2598835c54a3869a477d287d2845bbe42790a359 (diff) | |
download | blackshades-2.5.1.tar.gz |
Fix decal fading animation 2.5.1
Also fix missing decal regression. Fixes: 48417e11854f8 ("Make XYZ C-compatible")
Diffstat (limited to 'src/Models.cpp')
-rw-r--r-- | src/Models.cpp | 13 |
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) { |