/*
	name:	defs.h

	Global defenitions and includes
	-------------------------------


    This source-code is part of the RayLab 1.1 package, and it is provided
    for your compiling pleasure.  You may use it, change it, re-compile it
    etc., as long as nobody else but you receive the changes/compilations
    that you have made!

    You may not use any part(s) of this source-code for your own productions
    without the permission from the author of RayLab. Please read the legal
    information found in the users documentation for RayLab for more details.

*/

#include  <sys/types.h>
#include  <stdio.h>
#include  <math.h>

#include  "typedef.h"
#include  "protos.h"


#define parraymaxpix 5000		/* Maximum amount of pixels per line */
#define parraysize parraymaxpix
#define maxobjects 1000			/* Maximum amount of objects */
#define maxlights 100			/* Maximum amount of light-sources */
#define maximages 100			/* Maximum amount of 24bit/8bit images, respectively */
#define mincoord -100000.0		/* Minimum value for any x/y/z coordinate */
#define maxcoord 100000.0		/* Maximum value for any x/y/z coordinate */
#define maxsumcoord 3*maxcoord
#define aamaxlevel 9			/* Antialiasing recursion matrix (9 <=> 9x9 matrix <=> 4 recursions) */

#ifndef EPSILON
#define EPSILON 1.0e-7			/* A small value > 0 */
#endif
#ifndef PID4
#define PID4 0.78539816339744830962	/* PI/4 = 45 degrees */
#endif
#ifndef PID2
#define PID2 1.57079632679489661923	/* PI/2 = 90 degrees */
#endif
#ifndef PI
#define PI   3.14159265358979323846	/* PI   = 180 degrees */
#endif
#ifndef PIM2
#define PIM2 6.28318530717958647692	/* PI*2 = 360 degrees */
#endif
#define RADPDEG 0.01745329252480056695	/* 2PI / 360 */
#define DEGPRAD 57.29577951308234943	/* 360 / 2PI */
#define NUMEPSILON 1.0e-5		/* Presicion for numerical root-solving */

#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif

#ifdef OK
#if OK!=0
 Error: Constant OK!=0, cannot compile!
#endif
#else
#define OK 0
#endif

#define RENDER_TRACE     1		/* Define different rendering methods */
#define RENDER_QUICKSCAN 2

#define SHAPE_PLANE        1		/* Define shape identifiers */
#define SHAPE_SPHERE       2
#define SHAPE_ELLIPSOID    3
#define SHAPE_BOX          4
#define SHAPE_TRIANGLE     5
#define SHAPE_TRIANGLELIST 6
#define SHAPE_DISC         7
#define SHAPE_CYLINDER     8
#define SHAPE_CONE         9
#define SHAPE_TORUS       10
#define SHAPE_PEAK        11
#define SHAPE_DEOFLASKA   12
#define SHAPE_CSG         13

#define PATTERN_NONE       0		/* Define texture pattern identifiers */
#define PATTERN_CHECKER    1
#define PATTERN_CIRCLES    2
#define PATTERN_RINGS      3
#define PATTERN_SPOTS      4
#define PATTERN_GRADIENT   5
#define PATTERN_MARBLE     6
#define PATTERN_SOFTMARBLE 7
#define PATTERN_SQUARES    8
#define PATTERN_BLURB      9
#define PATTERN_MANDEL    10
#define PATTERN_WOOD      11
#define PATTERN_ANGULAR   12

#define IMG_NONE  0			/* Define image type identifiers */
#define IMG_24BIT 1
#define IMG_8BIT  2

#define MAP_PLANAR      1		/* Define image mappings */
#define MAP_SPHERICAL   2
#define MAP_CYLINDRICAL 3

#define INTPOL_NONE   0			/* Define different interpolation types */
#define INTPOL_LINEAR 1

#define TILE_TRUE  TRUE
#define TILE_FALSE FALSE

#define TRANSFORM_NONE   0		/* Define transform identifiers */
#define TRANSFORM_SCALE  1
#define TRANSFORM_MOVE   2
#define TRANSFORM_ROTATE 3
#define TRANSFORM_WHIRL  4		/* Transformation 4, 5, ... only has */
#define TRANSFORM_TWIST  5		/* effect on texture transformations */

#define PROJ_XY 1			/* Different 3D->2D projections for triangles */
#define PROJ_XZ 2
#define PROJ_YZ 3

#define CSG_OP_OR    1			/* Define csg operator identifiers */
#define CSG_OP_AND   2
#define CSG_OP_MINUS 3			/* _Always_ replaced by AND + INVERT */
#define CSG_OP_PLUS  4

#define CSG_INSIDE  TRUE
#define CSG_OUTSIDE FALSE

#define INVERT_TRUE  TRUE
#define INVERT_FALSE FALSE

#define CASTSHADOW_TRUE  TRUE
#define CASTSHADOW_FALSE FALSE

#define BOUND_NONE   0
#define BOUND_BOX    1
#define BOUND_SPHERE 2
#define BOUND_TMPBOX 3			/* Temporary bounding box, removed before rendering */

#define FORMAT_NONE 0			/* Output/input file formats */
#define FORMAT_IFF  1
#define FORMAT_TGA  2
#define FORMAT_PPM  3
#define FORMAT_DEFAULT FORMAT_IFF	/* Default output format */
