Subversion Repositories gelsvn

Rev

Rev 304 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 304 Rev 313
Line 112... Line 112...
112
	return false;
112
	return false;
113
}
113
}
114
*/
114
*/
115
  bool BBox::intersect_triangle(ISectTri &tri) 
115
  bool BBox::intersect_triangle(ISectTri &tri) 
116
  {
116
  {
117
    Vec3f tmin_corner = min_corner - Vec3f(0.01f,0.01f,0.01f);
117
    Vec3f tmin_corner = min_corner - Vec3f(f_eps);
118
    Vec3f tmax_corner = max_corner + Vec3f(0.01f,0.01f,0.01f);
118
    Vec3f tmax_corner = max_corner + Vec3f(f_eps);
119
 
119
 
120
    // Vertex in box test:
120
    // Vertex in box test:
121
    // If any of the triangle vertices are inside the box then 
121
    // If any of the triangle vertices are inside the box then 
122
    // the triangle intersects the box
122
    // the triangle intersects the box
123
    if (in_interval(tmin_corner[0],tri.point0[0],tmax_corner[0]) && in_interval(tmin_corner[1],tri.point0[1],tmax_corner[1]) && in_interval(tmin_corner[2],tri.point0[2],tmax_corner[2]))
123
    if (in_interval(tmin_corner[0],tri.point0[0],tmax_corner[0]) && in_interval(tmin_corner[1],tri.point0[1],tmax_corner[1]) && in_interval(tmin_corner[2],tri.point0[2],tmax_corner[2]))