Tachyon (current)
Current Main Branch
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "tachyon.h"
#include "vector.h"
#include "macros.h"
#include "intersect.h"
#include "util.h"
#include "triangle.h"
Go to the source code of this file.
Macros | |
#define | TACHYON_INTERNAL 1 |
#define | TRIANGLE_PRIVATE |
#define | CROSS(dest, v1, v2) |
#define | DOT(v1, v2) (v1.x*v2.x+v1.y*v2.y+v1.z*v2.z) |
#define | SUB(dest, v1, v2) |
Functions | |
object * | newtri (void *tex, vector v0, vector v1, vector v2) |
object * | newstri (void *tex, vector v0, vector v1, vector v2, vector n0, vector n1, vector n2) |
void | stri_normal_fixup (object *otri, int mode) |
object * | newvcstri (void *voidtex, vector v0, vector v1, vector v2, vector n0, vector n1, vector n2, color c0, color c1, color c2) |
void | vcstri_normal_fixup (object *otri, int mode) |
static int | tri_bbox (void *obj, vector *min, vector *max) |
static void | tri_intersect (const tri *trn, ray *ry) |
static void | tri_normal (const tri *trn, const vector *hit, const ray *incident, vector *N) |
static void | stri_normal (const stri *trn, const vector *hit, const ray *incident, vector *N) |
color | vcstri_color (const vector *hit, const texture *tx, const ray *incident) |
static void | stri_normal_reverse (const stri *trn, const vector *hit, const ray *incident, vector *N) |
static void | stri_normal_guess (const stri *trn, const vector *hit, const ray *incident, vector *N) |
Variables | |
static object_methods | tri_methods |
static object_methods | stri_methods |
static object_methods | stri_methods_reverse |
static object_methods | stri_methods_guess |
#define CROSS | ( | dest, | |
v1, | |||
v2 | |||
) |
Definition at line 206 of file triangle.c.
Referenced by stri_normal(), stri_normal_guess(), stri_normal_reverse(), tri_intersect(), tri_normal(), and vcstri_color().
#define DOT | ( | v1, | |
v2 | |||
) | (v1.x*v2.x+v1.y*v2.y+v1.z*v2.z) |
Definition at line 211 of file triangle.c.
Referenced by stri_normal(), stri_normal_guess(), stri_normal_reverse(), tri_intersect(), and vcstri_color().
#define SUB | ( | dest, | |
v1, | |||
v2 | |||
) |
Definition at line 213 of file triangle.c.
Referenced by tri_intersect().
#define TACHYON_INTERNAL 1 |
Definition at line 16 of file triangle.c.
#define TRIANGLE_PRIVATE |
Definition at line 23 of file triangle.c.
object* newstri | ( | void * | tex, |
vector | v0, | ||
vector | v1, | ||
vector | v2, | ||
vector | n0, | ||
vector | n1, | ||
vector | n2 | ||
) |
Definition at line 84 of file triangle.c.
References stri_methods, VLength(), and VSub().
Referenced by rt_stri(), and rt_stri3fv().
object* newtri | ( | void * | tex, |
vector | v0, | ||
vector | v1, | ||
vector | v2 | ||
) |
Definition at line 54 of file triangle.c.
References tri_methods, VLength(), and VSub().
Referenced by rt_tri(), and rt_tri3fv().
object* newvcstri | ( | void * | voidtex, |
vector | v0, | ||
vector | v1, | ||
vector | v2, | ||
vector | n0, | ||
vector | n1, | ||
vector | n2, | ||
color | c0, | ||
color | c1, | ||
color | c2 | ||
) |
Definition at line 141 of file triangle.c.
References stri_methods, vcstri_color(), VLength(), and VSub().
Referenced by rt_tristripscnv3fv(), rt_vcstri(), and rt_vcstri3fv().
|
static |
void stri_normal_fixup | ( | object * | otri, |
int | mode | ||
) |
Definition at line 118 of file triangle.c.
References stri_methods, stri_methods_guess, and stri_methods_reverse.
Referenced by rt_stri(), and rt_stri3fv().
|
static |
|
static |
|
static |
Definition at line 218 of file triangle.c.
|
static |
Definition at line 236 of file triangle.c.
|
static |
Definition at line 302 of file triangle.c.
color vcstri_color | ( | const vector * | hit, |
const texture * | tx, | ||
const ray * | incident | ||
) |
Definition at line 360 of file triangle.c.
References CROSS, DOT, and VSUB.
Referenced by newvcstri().
void vcstri_normal_fixup | ( | object * | otri, |
int | mode | ||
) |
Definition at line 183 of file triangle.c.
References stri_methods, stri_methods_guess, and stri_methods_reverse.
Referenced by rt_tristripscnv3fv(), rt_vcstri(), and rt_vcstri3fv().
|
static |
Definition at line 33 of file triangle.c.
Referenced by newstri(), newvcstri(), stri_normal_fixup(), and vcstri_normal_fixup().
|
static |
Definition at line 47 of file triangle.c.
Referenced by stri_normal_fixup(), and vcstri_normal_fixup().
|
static |
Definition at line 40 of file triangle.c.
Referenced by stri_normal_fixup(), and vcstri_normal_fixup().
|
static |
Definition at line 26 of file triangle.c.
Referenced by newtri().