- build system has to use 32bit (the code is not 64bit safe)
[genesis3d.git] / GBSPLib / MATHLIB.H
1 /****************************************************************************************/\r
2 /*  MathLib.h                                                                           */\r
3 /*                                                                                      */\r
4 /*  Author: John Pollard                                                                */\r
5 /*  Description: Various math functions not included in Vec3d.h, etc...                 */\r
6 /*                                                                                      */\r
7 /*  The contents of this file are subject to the Genesis3D Public License               */\r
8 /*  Version 1.01 (the "License"); you may not use this file except in                   */\r
9 /*  compliance with the License. You may obtain a copy of the License at                */\r
10 /*  http://www.genesis3d.com                                                            */\r
11 /*                                                                                      */\r
12 /*  Software distributed under the License is distributed on an "AS IS"                 */\r
13 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */\r
14 /*  the License for the specific language governing rights and limitations              */\r
15 /*  under the License.                                                                  */\r
16 /*                                                                                      */\r
17 /*  The Original Code is Genesis3D, released March 25, 1999.                            */\r
18 /*  Genesis3D Version 1.1 released November 15, 1999                                 */\r
19 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */\r
20 /*                                                                                      */\r
21 /****************************************************************************************/\r
22 #ifndef MATHLIB_H\r
23 #define MATHLIB_H\r
24 \r
25 #include "Vec3d.h"\r
26 \r
27 //#define       ON_EPSILON                      (geFloat)0.05\r
28 #define         ON_EPSILON                      (geFloat)0.1\r
29 //#define       ON_EPSILON                      0.05f\r
30 #define         VCOMPARE_EPSILON        ON_EPSILON \r
31 \r
32 //#define       MIN_MAX_BOUNDS          8192.0f\r
33 #define         MIN_MAX_BOUNDS          15192.0f\r
34 #define         MIN_MAX_BOUNDS2         MIN_MAX_BOUNDS*2\r
35 \r
36 #define         VectorToSUB(a, b)       (*(((geFloat*)&a) + b) )\r
37 \r
38 #define         PLANE_X                         0\r
39 #define         PLANE_Y                         1\r
40 #define         PLANE_Z                         2\r
41 #define         PLANE_ANYX                      3\r
42 #define         PLANE_ANYY                      4\r
43 #define         PLANE_ANYZ                      5\r
44 #define         PLANE_ANY                       6               \r
45 \r
46 extern          geVec3d                         VecOrigin;\r
47 \r
48 void            ClearBounds(geVec3d *Mins, geVec3d *Maxs);\r
49 void            AddPointToBounds(geVec3d *v, geVec3d *Mins, geVec3d *Maxs);\r
50 \r
51 geFloat         ColorNormalize(geVec3d *C1, geVec3d *C2);\r
52 geFloat         ColorClamp(geVec3d *C1, geFloat Clamp, geVec3d *C2);\r
53 \r
54 int32           geVec3d_PlaneType(geVec3d *V1);\r
55 \r
56 #endif\r