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

Go to the source code of this file.

Macros

#define TACHYON_INTERNAL   1
 

Functions

flt VDot (const vector *a, const vector *b)
 
void VCross (const vector *a, const vector *b, vector *c)
 
flt VLength (const vector *a)
 
void VNorm (vector *a)
 
void VAdd (const vector *a, const vector *b, vector *c)
 
void VSub (const vector *a, const vector *b, vector *c)
 
void VAddS (flt a, const vector *A, const vector *B, vector *C)
 
vector Raypnt (const ray *a, flt t)
 
void VScale (vector *a, flt s)
 
void ColorAddS (color *a, const color *b, flt s)
 
void ColorAccum (color *a, const color *b)
 
void ColorScale (color *a, flt s)
 

Macro Definition Documentation

◆ TACHYON_INTERNAL

#define TACHYON_INTERNAL   1

Definition at line 16 of file vector.c.

Function Documentation

◆ ColorAccum()

void ColorAccum ( color *  a,
const color *  b 
)

Definition at line 85 of file vector.c.

Referenced by full_shader(), and medium_shader().

◆ ColorAddS()

void ColorAddS ( color *  a,
const color *  b,
flt  s 
)

Definition at line 79 of file vector.c.

Referenced by full_shader(), and medium_shader().

◆ ColorScale()

void ColorScale ( color *  a,
flt  s 
)

Definition at line 91 of file vector.c.

Referenced by full_shader(), medium_shader(), shade_reflection(), and shade_transmission().

◆ Raypnt()

vector Raypnt ( const ray *  a,
flt  t 
)

◆ VAdd()

void VAdd ( const vector *  a,
const vector *  b,
vector *  c 
)

Definition at line 45 of file vector.c.

◆ VAddS()

void VAddS ( flt  a,
const vector *  A,
const vector *  B,
vector *  C 
)

Definition at line 57 of file vector.c.

◆ VCross()

void VCross ( const vector *  a,
const vector *  b,
vector *  c 
)

Definition at line 24 of file vector.c.

◆ VDot()

flt VDot ( const vector *  a,
const vector *  b 
)

Definition at line 20 of file vector.c.

◆ VLength()

flt VLength ( const vector *  a)

Definition at line 30 of file vector.c.

References SQRT.

Referenced by newstri(), newtri(), and newvcstri().

◆ VNorm()

void VNorm ( vector *  a)

Definition at line 34 of file vector.c.

References SQRT.

◆ VScale()

void VScale ( vector *  a,
flt  s 
)

Definition at line 73 of file vector.c.

Referenced by shade_phong().

◆ VSub()

void VSub ( const vector *  a,
const vector *  b,
vector *  c 
)

Definition at line 51 of file vector.c.