polygon_cube_intersection.cpp File Reference

#include "polygon_cube_intersection.h"
#include "vec.h"

Include dependency graph for polygon_cube_intersection.cpp:

Go to the source code of this file.


Namespaces

namespace  sofa
 Main SOFA namespace.
namespace  sofa::helper
 Utility helper classes that we need, but that are not the core of the plateform.
namespace  sofa::helper::polygon_cube_intersection

Defines

#define FOR(i, n)   for ((i) = 0; (i) < (n); ++(i))
#define MAXDIM2(v)   ((v)[0] > (v)[1] ? 0 : 1)
#define MAXDIM3(v)   ((v)[0] > (v)[2] ? MAXDIM2(v) : MAXDIM2((v)+1)+1)
#define ABS(x)   ((x)<0 ? -(x) : (x))
#define SQR(x)   ((x)*(x))
#define SIGN_NONZERO(x)   ((x) < 0 ? -1 : 1)
#define IN_CLOSED_INTERVAL(a, x, b)   (((x)-(a)) * ((x)-(b)) <= 0)
#define IN_OPEN_INTERVAL(a, x, b)   (((x)-(a)) * ((x)-(b)) < 0)
#define seg_contains_point(a, b, x)   (((b)>(x)) - ((a)>(x)))

Functions

int sofa::helper::polygon_cube_intersection::polygon_contains_point_3d (int nverts, const float verts[][3], const float polynormal[3], float point[3])
int sofa::helper::polygon_cube_intersection::segment_intersects_cube (const float v0[3], const float v1[3])
int sofa::helper::polygon_cube_intersection::polygon_intersects_cube (int nverts, const float verts[][3], const float polynormal[3], int, int already_know_edges_are_outside_cube)
float * sofa::helper::polygon_cube_intersection::get_polygon_normal (float normal[3], int nverts, const float verts[][3])


Define Documentation

#define ABS ( x   )     ((x)<0 ? -(x) : (x))

#define FOR ( i,
n   )     for ((i) = 0; (i) < (n); ++(i))

#define IN_CLOSED_INTERVAL ( a,
x,
b   )     (((x)-(a)) * ((x)-(b)) <= 0)

#define IN_OPEN_INTERVAL ( a,
x,
b   )     (((x)-(a)) * ((x)-(b)) < 0)

Definition at line 64 of file polygon_cube_intersection.cpp.

#define MAXDIM2 ( v   )     ((v)[0] > (v)[1] ? 0 : 1)

Definition at line 57 of file polygon_cube_intersection.cpp.

#define MAXDIM3 ( v   )     ((v)[0] > (v)[2] ? MAXDIM2(v) : MAXDIM2((v)+1)+1)

#define seg_contains_point ( a,
b,
x   )     (((b)>(x)) - ((a)>(x)))

#define SIGN_NONZERO ( x   )     ((x) < 0 ? -1 : 1)

#define SQR ( x   )     ((x)*(x))

Definition at line 60 of file polygon_cube_intersection.cpp.

Referenced by sofa::defaulttype::pythag().


Generated on Sun Nov 23 04:07:24 2008 for Sofa by  doxygen 1.5.7.1