16 #define TACHYON_INTERNAL 1 28 (
void (*)(
const void *,
const void *,
const void *,
void *))(
plane_normal),
33 object *
newplane(
void * tex, vector ctr, vector norm) {
36 p=(plane *) malloc(
sizeof(plane));
37 memset(p, 0,
sizeof(plane));
43 p->d = -
VDot(&ctr, &p->norm);
48 static int plane_bbox(
void * obj, vector * min, vector * max) {
57 t = -(pln->d + (pln->norm.x * ry->o.x +
58 pln->norm.y * ry->o.y +
59 pln->norm.z * ry->o.z));
61 td = pln->norm.x * ry->d.x + pln->norm.y * ry->d.y + pln->norm.z * ry->d.z;
66 ry->add_intersection(t,(
object *) pln, ry);
70 static void plane_normal(
const plane * pln,
const vector * pnt,
const ray * incident, vector * N) {
74 if (
VDot(N, &(incident->d)) > 0.0) {
static object_methods plane_methods
static int plane_bbox(void *obj, vector *min, vector *max)
static void plane_normal(const plane *pln, const vector *pnt, const ray *incident, vector *N)
flt VDot(apivector *a, apivector *b)
double flt
generic floating point number, using double
object * newplane(void *tex, vector ctr, vector norm)
Tachyon cross-platform timers, special math function wrappers, and RNGs.
static void plane_intersect(const plane *pln, ray *ry)
Tachyon public API function prototypes and declarations used to drive the ray tracing engine...