Biomechanical Joint Model
 Author: Anderson Maciel

ray.h

Go to the documentation of this file.
00001 #ifndef RAY_H
00002 #define RAY_H
00003 
00004 using namespace LinAlg;
00005 #include <LinAlg/vecarray.h>
00006 
00007 #include <vector>
00008    using namespace std;
00009 
00010    //typedef VVV vector<int>;
00011 
00012    struct Ray {
00013       VEC O;        // ray origin
00014       VEC D;        // ray direction
00015       VEC P;        // intersection point
00016       REAL t;       // distance from O to P w.r.t. D's norm
00017       bool segment; // sometimes we're just interested in the intersection 
00018                     // with a segment (of length D's norm)
00019       Ray() : O(3), D(3), P(3), t(0), segment(false) {};
00020       Ray(const VEC &origin, const VEC &dir) : O(origin), D(dir), P(3), t(0), segment(false) {};
00021       Ray(const Ray &r) : O(r.O), D(r.D), P(r.P), t(r.t), segment(r.segment) {};
00022    };
00023 
00024    //class BBox;
00025    //class BBoxHierarchy;
00026 
00027    bool intersect_triangle ( const VEC &orig, const VEC &dir,
00028                              const VEC &v0, const VEC &v1, const VEC &v2,
00029                              REAL &t, REAL &u, REAL &v );
00030 
00031    vector<int> find_closest(const VEC &X, const VECArray &Y, int m, REAL radius=infinity);
00032 
00033    int project_on_mesh_tmp(const VEC &X, const VECArray &vertlist, 
00034                        const VECArray &normlist, const vector<int> &trilist, 
00035                        REAL &u, REAL &v, VEC &P);
00036 
00037    int project_on_mesh(const VEC &X, const  VECArray &vertlist, const vector<int> &trilist,
00038                        REAL &u, REAL &v, VEC &P);
00039 
00040 
00041 
00042 
00043 #endif

Generated on Thu Dec 1 10:13:40 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5