TooN Algorithm Library - tag  0.2
Functions
3D intersections

Functions

template<typename A , typename B , typename C , typename D , typename ABase , typename BBase , typename CBase , typename DBase >
bool tag::intersect_plane_line (const TooN::Vector< 3, A, ABase > &normal, const double d, const TooN::Vector< 3, B, BBase > &p1, const TooN::Vector< 3, C, CBase > &p2, TooN::Vector< 3, D, DBase > &i)
 
bool tag::intersect_triangle (const TooN::Vector< 3 > &orig, const TooN::Vector< 3 > &dir, const TooN::Vector< 3 > &vert0, const TooN::Vector< 3 > &vert1, const TooN::Vector< 3 > &vert2, double &t, double &u, double &v)
 
bool tag::intersect_culled_triangle (const TooN::Vector< 3 > &orig, const TooN::Vector< 3 > &dir, const TooN::Vector< 3 > &vert0, const TooN::Vector< 3 > &vert1, const TooN::Vector< 3 > &vert2, double &t, double &u, double &v)
 
bool tag::intersect_triangles (const TooN::Vector< 3 > &v1, const TooN::Vector< 3 > &v2, const TooN::Vector< 3 > &v3, const TooN::Vector< 3 > &w1, const TooN::Vector< 3 > &w2, const TooN::Vector< 3 > &w3, TooN::Vector< 3 > &p1, TooN::Vector< 3 > &p2)
 

Detailed Description

This group contains a set of functions to compute intersections between various 3D structures

Function Documentation

bool tag::intersect_culled_triangle ( const TooN::Vector< 3 > &  orig,
const TooN::Vector< 3 > &  dir,
const TooN::Vector< 3 > &  vert0,
const TooN::Vector< 3 > &  vert1,
const TooN::Vector< 3 > &  vert2,
double &  t,
double &  u,
double &  v 
)
inline

computes the intersection between a line and a backfaced culled triangle.

template<typename A , typename B , typename C , typename D , typename ABase , typename BBase , typename CBase , typename DBase >
bool tag::intersect_plane_line ( const TooN::Vector< 3, A, ABase > &  normal,
const double  d,
const TooN::Vector< 3, B, BBase > &  p1,
const TooN::Vector< 3, C, CBase > &  p2,
TooN::Vector< 3, D, DBase > &  i 
)
inline

computes the point of intersection between a plane (given as normal and constant) and a line (given as two points on the line). It does not do any normalization of plane normal or distance between points! therefore the test for plane and line being parallel might depend on the magnitude of these vectors.

Referenced by tag::intersect_triangles().

bool tag::intersect_triangle ( const TooN::Vector< 3 > &  orig,
const TooN::Vector< 3 > &  dir,
const TooN::Vector< 3 > &  vert0,
const TooN::Vector< 3 > &  vert1,
const TooN::Vector< 3 > &  vert2,
double &  t,
double &  u,
double &  v 
)
inline

computes the intersection between a line and a triangle.

bool tag::intersect_triangles ( const TooN::Vector< 3 > &  v1,
const TooN::Vector< 3 > &  v2,
const TooN::Vector< 3 > &  v3,
const TooN::Vector< 3 > &  w1,
const TooN::Vector< 3 > &  w2,
const TooN::Vector< 3 > &  w3,
TooN::Vector< 3 > &  p1,
TooN::Vector< 3 > &  p2 
)
inline

computes the intersection between two triangles.

References tag::intersect_plane_line().