Tachyon (current)  Current Main Branch
Macros | Functions
camera.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 "camera.h"
#include "util.h"
#include "intersect.h"

Go to the source code of this file.

Macros

#define TACHYON_INTERNAL   1
 

Functions

void camera_init (scenedef *scene)
 
void camray_init (scenedef *scene, ray *primary, unsigned long serial, unsigned long *mbox, unsigned int aarandval, unsigned int aorandval)
 
color cam_perspective_aa_dof_ray (ray *ry, flt x, flt y)
 
color cam_perspective_dof_ray (ray *ry, flt x, flt y)
 
color cam_perspective_aa_ray (ray *ry, flt x, flt y)
 
void cam_prep_perspective_ray (ray *ry, flt x, flt y)
 
color cam_perspective_ray (ray *ry, flt x, flt y)
 
color cam_orthographic_aa_dof_ray (ray *ry, flt x, flt y)
 
color cam_orthographic_dof_ray (ray *ry, flt x, flt y)
 
color cam_orthographic_aa_ray (ray *ry, flt x, flt y)
 
color cam_orthographic_ray (ray *ry, flt x, flt y)
 
color cam_equirectangular_ray (ray *ry, flt x, flt y)
 
color cam_equirectangular_aa_ray (ray *ry, flt x, flt y)
 
color cam_equirectangular_stereo_ray (ray *ry, flt x, flt y)
 
color cam_equirectangular_aa_stereo_ray (ray *ry, flt x, flt y)
 
color cam_fisheye_ray (ray *ry, flt x, flt y)
 
color cam_fisheye_aa_ray (ray *ry, flt x, flt y)
 
void cameraprojection (camdef *camera, int mode)
 
void camerafrustum (camdef *camera, flt left, flt right, flt bottom, flt top)
 When the user directly specifies the world coordinates of the view frustum, it overrides the normal calculations involving zoom factor, aspect ratio, etc. More...
 
void cameradof (camdef *camera, flt focaldist, flt aperture)
 
void camerazoom (camdef *camera, flt zoom)
 
void cameradefault (camdef *camera)
 
void cameraposition (camdef *camera, vector center, vector viewvec, vector upvec)
 
void getcameraposition (camdef *camera, vector *center, vector *viewvec, vector *upvec, vector *rightvec)
 

Macro Definition Documentation

◆ TACHYON_INTERNAL

#define TACHYON_INTERNAL   1

Definition at line 20 of file camera.c.

Function Documentation

◆ cam_equirectangular_aa_ray()

color cam_equirectangular_aa_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 769 of file camera.c.

References cam_equirectangular_ray(), and jitter_offset2f().

◆ cam_equirectangular_aa_stereo_ray()

color cam_equirectangular_aa_stereo_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 901 of file camera.c.

References cam_equirectangular_stereo_ray(), and jitter_offset2f().

Referenced by camera_init().

◆ cam_equirectangular_ray()

color cam_equirectangular_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 708 of file camera.c.

References intersect_objects(), SINCOS, and SQRT.

Referenced by cam_equirectangular_aa_ray().

◆ cam_equirectangular_stereo_ray()

color cam_equirectangular_stereo_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 808 of file camera.c.

References fabsf(), intersect_objects(), SINCOS, SQRT, and VCross().

Referenced by cam_equirectangular_aa_stereo_ray(), and camera_init().

◆ cam_fisheye_aa_ray()

color cam_fisheye_aa_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 972 of file camera.c.

References cam_fisheye_ray(), and jitter_offset2f().

Referenced by camera_init().

◆ cam_fisheye_ray()

color cam_fisheye_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 936 of file camera.c.

References COS, intersect_objects(), and SIN.

Referenced by cam_fisheye_aa_ray(), and camera_init().

◆ cam_orthographic_aa_dof_ray()

color cam_orthographic_aa_dof_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 536 of file camera.c.

References cam_orthographic_dof_ray(), cam_orthographic_ray(), and jitter_offset2f().

Referenced by camera_init().

◆ cam_orthographic_aa_ray()

color cam_orthographic_aa_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 638 of file camera.c.

References cam_orthographic_ray(), and jitter_offset2f().

Referenced by camera_init().

◆ cam_orthographic_dof_ray()

color cam_orthographic_dof_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 571 of file camera.c.

References intersect_objects(), jitter_disc2f(), and VNorm().

Referenced by cam_orthographic_aa_dof_ray().

◆ cam_orthographic_ray()

color cam_orthographic_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 673 of file camera.c.

References intersect_objects().

Referenced by cam_orthographic_aa_dof_ray(), cam_orthographic_aa_ray(), and camera_init().

◆ cam_perspective_aa_dof_ray()

color cam_perspective_aa_dof_ray ( ray *  ry,
flt  x,
flt  y 
)

◆ cam_perspective_aa_ray()

color cam_perspective_aa_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 439 of file camera.c.

References cam_perspective_ray(), cam_prep_perspective_ray(), and jitter_offset2f().

Referenced by camera_init().

◆ cam_perspective_dof_ray()

color cam_perspective_dof_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 365 of file camera.c.

References intersect_objects(), jitter_disc2f(), SQRT, and VNorm().

Referenced by cam_perspective_aa_dof_ray().

◆ cam_perspective_ray()

color cam_perspective_ray ( ray *  ry,
flt  x,
flt  y 
)

◆ cam_prep_perspective_ray()

void cam_prep_perspective_ray ( ray *  ry,
flt  x,
flt  y 
)

Definition at line 482 of file camera.c.

References SQRT.

Referenced by cam_perspective_aa_dof_ray(), cam_perspective_aa_ray(), and cam_perspective_ray().

◆ camera_init()

void camera_init ( scenedef *  scene)

◆ cameradefault()

void cameradefault ( camdef *  camera)

Definition at line 1049 of file camera.c.

References camerazoom().

Referenced by rt_camera_setup().

◆ cameradof()

void cameradof ( camdef *  camera,
flt  focaldist,
flt  aperture 
)

Definition at line 1024 of file camera.c.

Referenced by rt_camera_dof().

◆ camerafrustum()

void camerafrustum ( camdef *  camera,
flt  left,
flt  right,
flt  bottom,
flt  top 
)

When the user directly specifies the world coordinates of the view frustum, it overrides the normal calculations involving zoom factor, aspect ratio, etc.

The caller must therefore be responsible for making sure that all of these factors work out. We wash our hands of all of the usual automatic computations and use these factors as-is.

Definition at line 1015 of file camera.c.

Referenced by rt_camera_frustum().

◆ cameraposition()

void cameraposition ( camdef *  camera,
vector  center,
vector  viewvec,
vector  upvec 
)

Definition at line 1056 of file camera.c.

References VCross(), and VNorm().

Referenced by rt_camera_position(), and rt_camera_position3fv().

◆ cameraprojection()

void cameraprojection ( camdef *  camera,
int  mode 
)

Definition at line 1003 of file camera.c.

Referenced by rt_camera_projection().

◆ camerazoom()

void camerazoom ( camdef *  camera,
flt  zoom 
)

Definition at line 1041 of file camera.c.

Referenced by cameradefault(), and rt_camera_zoom().

◆ camray_init()

void camray_init ( scenedef *  scene,
ray *  primary,
unsigned long  serial,
unsigned long *  mbox,
unsigned int  aarandval,
unsigned int  aorandval 
)

◆ getcameraposition()

void getcameraposition ( camdef *  camera,
vector *  center,
vector *  viewvec,
vector *  upvec,
vector *  rightvec 
)

Definition at line 1079 of file camera.c.

Referenced by rt_get_camera_position(), and rt_get_camera_position3fv().