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

Go to the source code of this file.

Macros

#define TACHYON_INTERNAL   1
 
#define CYLINDER_PRIVATE
 

Functions

object * newcylinder (void *tex, vector ctr, vector axis, flt rad)
 
static int cylinder_bbox (void *obj, vector *min, vector *max)
 
static void cylinder_intersect (const cylinder *cyl, ray *ry)
 
static void cylinder_normal (const cylinder *cyl, const vector *pnt, const ray *incident, vector *N)
 
object * newfcylinder (void *tex, vector ctr, vector axis, flt rad)
 
static int fcylinder_bbox (void *obj, vector *min, vector *max)
 
static void fcylinder_intersect (const cylinder *cyl, ray *ry)
 

Variables

static object_methods cylinder_methods
 
static object_methods fcylinder_methods
 

Macro Definition Documentation

◆ CYLINDER_PRIVATE

#define CYLINDER_PRIVATE

Definition at line 23 of file cylinder.c.

◆ TACHYON_INTERNAL

#define TACHYON_INTERNAL   1

Definition at line 16 of file cylinder.c.

Function Documentation

◆ cylinder_bbox()

static int cylinder_bbox ( void *  obj,
vector *  min,
vector *  max 
)
static

Definition at line 55 of file cylinder.c.

◆ cylinder_intersect()

static void cylinder_intersect ( const cylinder *  cyl,
ray *  ry 
)
static

Definition at line 59 of file cylinder.c.

References FABS, SQRT, VCross(), and VDOT.

◆ cylinder_normal()

static void cylinder_normal ( const cylinder *  cyl,
const vector *  pnt,
const ray *  incident,
vector *  N 
)
static

Definition at line 110 of file cylinder.c.

References SQRT, VDOT, and VDot().

◆ fcylinder_bbox()

static int fcylinder_bbox ( void *  obj,
vector *  min,
vector *  max 
)
static

Definition at line 159 of file cylinder.c.

References MYMAX, and MYMIN.

◆ fcylinder_intersect()

static void fcylinder_intersect ( const cylinder *  cyl,
ray *  ry 
)
static

Definition at line 188 of file cylinder.c.

References FABS, RAYPNT, SQRT, VCross(), VDOT, and VNorm().

◆ newcylinder()

object* newcylinder ( void *  tex,
vector  ctr,
vector  axis,
flt  rad 
)

Definition at line 41 of file cylinder.c.

References cylinder_methods.

Referenced by rt_cylinder(), and rt_cylinder3fv().

◆ newfcylinder()

object* newfcylinder ( void *  tex,
vector  ctr,
vector  axis,
flt  rad 
)

Definition at line 144 of file cylinder.c.

References fcylinder_methods.

Referenced by rt_fcylinder(), and rt_fcylinder3fv().

Variable Documentation

◆ cylinder_methods

object_methods cylinder_methods
static
Initial value:
= {
(void (*)(const void *, void *))(cylinder_intersect),
(void (*)(const void *, const void *, const void *, void *))(cylinder_normal),
free
}
static void cylinder_normal(const cylinder *cyl, const vector *pnt, const ray *incident, vector *N)
Definition: cylinder.c:110
static void cylinder_intersect(const cylinder *cyl, ray *ry)
Definition: cylinder.c:59
static int cylinder_bbox(void *obj, vector *min, vector *max)
Definition: cylinder.c:55

Definition at line 26 of file cylinder.c.

Referenced by newcylinder().

◆ fcylinder_methods

object_methods fcylinder_methods
static
Initial value:
= {
(void (*)(const void *, void *))(fcylinder_intersect),
(void (*)(const void *, const void *, const void *, void *))(cylinder_normal),
free
}
static void fcylinder_intersect(const cylinder *cyl, ray *ry)
Definition: cylinder.c:188
static void cylinder_normal(const cylinder *cyl, const vector *pnt, const ray *incident, vector *N)
Definition: cylinder.c:110
static int fcylinder_bbox(void *obj, vector *min, vector *max)
Definition: cylinder.c:159

Definition at line 33 of file cylinder.c.

Referenced by newfcylinder().