vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
triangleCube.cpp File Reference

Classes

struct  Point3f
 
struct  Triangle3v
 

Macros

#define EPS   10e-5
 
#define SIGN3(A)
 
#define CROSS(A, B, C)
 
#define SUB(A, B, C)
 
#define LERP(A, B, C)   ((B)+(A)*((C)-(B)))
 
#define MIN3(a, b, c)   ((((a)<(b))&&((a)<(c))) ? (a) : (((b)<(c)) ? (b) : (c)))
 
#define MAX3(a, b, c)   ((((a)>(b))&&((a)>(c))) ? (a) : (((b)>(c)) ? (b) : (c)))
 
#define INSIDE   0
 
#define OUTSIDE   1
 

Functions

long face_plane (Point3 p)
 
long bevel_2d (Point3 p)
 
long bevel_3d (Point3 p)
 
long check_point (Point3 p1, Point3 p2, float alpha, long mask)
 
long check_line (Point3 p1, Point3 p2, long outcode_diff)
 
long point_triangle_intersection (Point3 p, Triangle3 t)
 
long t_c_intersection (Triangle3 t)
 

Macro Definition Documentation

#define CROSS (   A,
  B,
 
)
Value:
{ \
(C).x = (A).y * (B).z - (A).z * (B).y; \
(C).y = -(A).x * (B).z + (A).z * (B).x; \
(C).z = (A).x * (B).y - (A).y * (B).x; \
}
#define EPS   10e-5
#define INSIDE   0
#define LERP (   A,
  B,
 
)    ((B)+(A)*((C)-(B)))
#define MAX3 (   a,
  b,
 
)    ((((a)>(b))&&((a)>(c))) ? (a) : (((b)>(c)) ? (b) : (c)))
#define MIN3 (   a,
  b,
 
)    ((((a)<(b))&&((a)<(c))) ? (a) : (((b)<(c)) ? (b) : (c)))
#define OUTSIDE   1
#define SIGN3 (   A)
Value:
(((A).x < EPS) ? 4 : 0 | ((A).x > -EPS) ? 32 : 0 | \
((A).y < EPS) ? 2 : 0 | ((A).y > -EPS) ? 16 : 0 | \
((A).z < EPS) ? 1 : 0 | ((A).z > -EPS) ? 8 : 0)
#define SUB (   A,
  B,
 
)
Value:
{ \
(C).x = (A).x - (B).x; \
(C).y = (A).y - (B).y; \
(C).z = (A).z - (B).z; \
}

Function Documentation

long bevel_2d ( Point3  p)
long bevel_3d ( Point3  p)
long check_line ( Point3  p1,
Point3  p2,
long  outcode_diff 
)
long check_point ( Point3  p1,
Point3  p2,
float  alpha,
long  mask 
)
long face_plane ( Point3  p)
long point_triangle_intersection ( Point3  p,
Triangle3  t 
)
long t_c_intersection ( Triangle3  t)