Tachyon (current)  Current Main Branch
Macros | Functions | Variables
box.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "tachyon.h"
#include "macros.h"
#include "box.h"
#include "vector.h"
#include "intersect.h"
#include "util.h"

Go to the source code of this file.

Macros

#define TACHYON_INTERNAL   1
 

Functions

int box_bbox (void *obj, vector *min, vector *max)
 
boxnewbox (void *tex, vector min, vector max)
 
void box_intersect (const box *bx, ray *ry)
 
void box_normal (const box *bx, const vector *pnt, const ray *incident, vector *N)
 

Variables

static object_methods box_methods
 

Macro Definition Documentation

◆ TACHYON_INTERNAL

#define TACHYON_INTERNAL   1

Definition at line 16 of file box.c.

Function Documentation

◆ box_bbox()

int box_bbox ( void *  obj,
vector *  min,
vector *  max 
)

Definition at line 24 of file box.c.

References box::max, and box::min.

◆ box_intersect()

void box_intersect ( const box bx,
ray *  ry 
)

Definition at line 53 of file box.c.

References box::max, and box::min.

Referenced by newparvol().

◆ box_normal()

void box_normal ( const box bx,
const vector *  pnt,
const ray *  incident,
vector *  N 
)

Definition at line 103 of file box.c.

References FABS, box::max, box::min, MYMAX, VDot(), VNorm(), and VSub().

Referenced by newparvol().

◆ newbox()

box* newbox ( void *  tex,
vector  min,
vector  max 
)

Definition at line 40 of file box.c.

References box_methods, box::max, and box::min.

Referenced by newscalarvol(), and rt_box().

Variable Documentation

◆ box_methods

object_methods box_methods
static
Initial value:
= {
(void (*)(const void *, void *))(box_intersect),
(void (*)(const void *, const void *, const void *, void *))(box_normal),
free
}
void box_intersect(const box *bx, ray *ry)
Definition: box.c:53
int box_bbox(void *obj, vector *min, vector *max)
Definition: box.c:24
void box_normal(const box *bx, const vector *pnt, const ray *incident, vector *N)
Definition: box.c:103

Definition at line 33 of file box.c.

Referenced by newbox().