aboutsummaryrefslogtreecommitdiff
path: root/Source/Models.cpp
diff options
context:
space:
mode:
authorrelnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-01-09 07:00:42 +0000
committerrelnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-01-09 07:00:42 +0000
commit3c26e109a39e97951353fb872f151b520955a376 (patch)
treec7b9342f87c9d921bb1809f35527abed8770ba68 /Source/Models.cpp
parenta00e7a1f4d0147a0a34cda12064a10504747fdc8 (diff)
downloadblackshades-3c26e109a39e97951353fb872f151b520955a376.tar.gz
crap
git-svn-id: svn://svn.icculus.org/blackshades/trunk@62 5198baeb-e213-0410-be47-fc2ff85ca46f
Diffstat (limited to 'Source/Models.cpp')
-rw-r--r--Source/Models.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Models.cpp b/Source/Models.cpp
index 70d796e..8caefd8 100644
--- a/Source/Models.cpp
+++ b/Source/Models.cpp
@@ -249,6 +249,7 @@ int Model::LineCheck(XYZ p1,XYZ p2, XYZ *p)
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);
+ 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;}
}
@@ -273,6 +274,7 @@ int Model::LineCheck2(XYZ p1,XYZ p2, XYZ *p, XYZ move, float rotate)
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);
+ 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;}
}
@@ -300,6 +302,7 @@ int Model::LineCheck2(XYZ *p1,XYZ *p2, XYZ *p, XYZ *move, float *rotate)
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);
+ 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;}
}
@@ -327,6 +330,7 @@ int Model::LineCheck3(XYZ p1,XYZ p2, XYZ *p, XYZ move, float rotate, float *d)
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);
+ 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;}
}