Teem 1.10.0
src/echo/intx.c File Reference
#include "echo.h"
#include "privateEcho.h"
Include dependency graph for intx.c:

Defines

#define TRI_INTX(ray, origin, edge0, edge1, pvec, qvec, tvec,det, t, u, v, COND, NOPE)

Functions

int _echoRayIntx_Noop (RAYINTX_ARGS(Object))
int _echoRayIntx_CubeSurf (echoPos_t *tP, int *axP, int *dirP, echoPos_t xmin, echoPos_t xmax, echoPos_t ymin, echoPos_t ymax, echoPos_t zmin, echoPos_t zmax, echoRay *ray)
int _echoRayIntx_CubeSolid (echoPos_t *tminP, echoPos_t *tmaxP, echoPos_t xmin, echoPos_t xmax, echoPos_t ymin, echoPos_t ymax, echoPos_t zmin, echoPos_t zmax, echoRay *ray)
int _echoRayIntx_Sphere (RAYINTX_ARGS(Sphere))
void _echoRayIntxUV_Sphere (echoIntx *intx)
int _echoRayIntx_Cylinder (RAYINTX_ARGS(Cylinder))
int _echoRayIntx_Cube (RAYINTX_ARGS(Cube))
void _echoRayIntxUV_Cube (echoIntx *intx)
int _echoRayIntx_Rectangle (RAYINTX_ARGS(Rectangle))
int _echoRayIntx_Triangle (RAYINTX_ARGS(Triangle))
int _echoRayIntx_TriMesh (RAYINTX_ARGS(TriMesh))
void _echoRayIntxUV_TriMesh (echoIntx *intx)
int _echoRayIntx_AABBox (RAYINTX_ARGS(AABBox))
int _echoRayIntx_Split (RAYINTX_ARGS(Split))
int _echoRayIntx_List (RAYINTX_ARGS(List))
int _echoRayIntx_Instance (RAYINTX_ARGS(Instance))
void _echoRayIntxUV_Noop (echoIntx *intx)
int echoRayIntx (echoIntx *intx, echoRay *ray, echoScene *scene, echoRTParm *parm, echoThreadState *tstate)

Variables

int _echoVerbose = 0
_echoRayIntx_t _echoRayIntx [ECHO_TYPE_NUM]
_echoRayIntxUV_t _echoRayIntxUV [ECHO_TYPE_NUM]

Define Documentation

#define TRI_INTX (   ray,
  origin,
  edge0,
  edge1,
  pvec,
  qvec,
  tvec,
  det,
  t,
  u,
  v,
  COND,
  NOPE 
)
Value:
ELL_3V_CROSS(pvec, ray->dir, edge1);                                       \
  det = ELL_3V_DOT(pvec, edge0);                                             \
  if (det > -ECHO_EPSILON && det < ECHO_EPSILON) {                           \
    NOPE;                                                                    \
  }                                                                          \
  /* now det is the reciprocal of the determinant */                         \
  det = 1.0/det;                                                             \
  ELL_3V_SUB(tvec, ray->from, origin);                                       \
  u = det * ELL_3V_DOT(pvec, tvec);                                          \
  if (u < 0.0 || u > 1.0) {                                                  \
    NOPE;                                                                    \
  }                                                                          \
  ELL_3V_CROSS(qvec, tvec, edge0);                                           \
  v = det * ELL_3V_DOT(qvec, ray->dir);                                      \
  if (COND) {                                                                \
    NOPE;                                                                    \
  }                                                                          \
  t = det * ELL_3V_DOT(qvec, edge1);                                         \
  if (t < ray->neer || t > ray->faar) {                                      \
    NOPE;                                                                    \
  }

Function Documentation

int _echoRayIntx_AABBox ( RAYINTX_ARGS(AABBox)  )
int _echoRayIntx_Cube ( RAYINTX_ARGS(Cube)  )
int _echoRayIntx_CubeSolid ( echoPos_t tminP,
echoPos_t tmaxP,
echoPos_t  xmin,
echoPos_t  xmax,
echoPos_t  ymin,
echoPos_t  ymax,
echoPos_t  zmin,
echoPos_t  zmax,
echoRay ray 
)
int _echoRayIntx_CubeSurf ( echoPos_t tP,
int *  axP,
int *  dirP,
echoPos_t  xmin,
echoPos_t  xmax,
echoPos_t  ymin,
echoPos_t  ymax,
echoPos_t  zmin,
echoPos_t  zmax,
echoRay ray 
)
int _echoRayIntx_Cylinder ( RAYINTX_ARGS(Cylinder)  )
int _echoRayIntx_Instance ( RAYINTX_ARGS(Instance)  )
int _echoRayIntx_List ( RAYINTX_ARGS(List)  )
int _echoRayIntx_Noop ( RAYINTX_ARGS(Object)  )
int _echoRayIntx_Rectangle ( RAYINTX_ARGS(Rectangle)  )
int _echoRayIntx_Sphere ( RAYINTX_ARGS(Sphere)  )
int _echoRayIntx_Split ( RAYINTX_ARGS(Split)  )
int _echoRayIntx_Triangle ( RAYINTX_ARGS(Triangle)  )
int _echoRayIntx_TriMesh ( RAYINTX_ARGS(TriMesh)  )
void _echoRayIntxUV_Cube ( echoIntx intx)
void _echoRayIntxUV_Noop ( echoIntx intx)
void _echoRayIntxUV_Sphere ( echoIntx intx)
void _echoRayIntxUV_TriMesh ( echoIntx intx)
int echoRayIntx ( echoIntx intx,
echoRay ray,
echoScene scene,
echoRTParm parm,
echoThreadState tstate 
)

Variable Documentation

int _echoVerbose = 0