diff options
Diffstat (limited to 'src/Models.cpp')
-rw-r--r-- | src/Models.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Models.cpp b/src/Models.cpp index 6632562..ad0f357 100644 --- a/src/Models.cpp +++ b/src/Models.cpp @@ -54,7 +54,7 @@ void Model::CalculateNormals() boundingsphereradius = 0; for (int i = 0; i < vertexNum; ++i) - boundingsphereradius = max(boundingsphereradius, + boundingsphereradius = std::max(boundingsphereradius, findDistancefast(boundingspherecenter, vertex[i])); boundingsphereradius = sqrt(boundingsphereradius); } @@ -186,7 +186,11 @@ int Model::LineCheck2(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate) boundingspherecenter.x,boundingspherecenter.y,boundingspherecenter.z, boundingsphereradius)) for (j=0;j<TriangleNum;j++){ - intersecting=LineFacetd(p1,p2,&vertex[Triangles[j].vertex[0]],&vertex[Triangles[j].vertex[1]],&vertex[Triangles[j].vertex[2]],&normals[j],&point); + intersecting = LineFacetd(*p1, *p2, + vertex[Triangles[j].vertex[0]], + vertex[Triangles[j].vertex[1]], + vertex[Triangles[j].vertex[2]], + normals[j], &point); if (intersecting == 0) continue; distance=(point.x-p1->x)*(point.x-p1->x)+(point.y-p1->y)*(point.y-p1->y)+(point.z-p1->z)*(point.z-p1->z); if((distance<olddistance||firstintersecting==-1)&&intersecting){olddistance=distance; firstintersecting=j; *p=point;} |