istereo
annotate libs/vmath/vmath_types.h @ 33:33e9eedad390
ah.. blunder
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Fri, 09 Sep 2011 00:03:37 +0300 |
parents | |
children | ff055bff6a15 |
rev | line source |
---|---|
nuclear@28 | 1 #ifndef VMATH_TYPES_H_ |
nuclear@28 | 2 #define VMATH_TYPES_H_ |
nuclear@28 | 3 |
nuclear@28 | 4 #include "vmath_config.h" |
nuclear@28 | 5 |
nuclear@28 | 6 #define SMALL_NUMBER 1.e-4 |
nuclear@28 | 7 #define XSMALL_NUMBER 1.e-8 |
nuclear@28 | 8 #define ERROR_MARGIN 1.e-6 |
nuclear@28 | 9 |
nuclear@28 | 10 |
nuclear@28 | 11 #ifdef SINGLE_PRECISION_MATH |
nuclear@28 | 12 typedef float scalar_t; |
nuclear@28 | 13 #else |
nuclear@28 | 14 typedef double scalar_t; |
nuclear@28 | 15 #endif /* floating point precision */ |
nuclear@28 | 16 |
nuclear@28 | 17 /* vectors */ |
nuclear@28 | 18 typedef struct { scalar_t x, y; } vec2_t; |
nuclear@28 | 19 typedef struct { scalar_t x, y, z; } vec3_t; |
nuclear@28 | 20 typedef struct { scalar_t x, y, z, w; } vec4_t; |
nuclear@28 | 21 |
nuclear@28 | 22 /* quaternions */ |
nuclear@28 | 23 typedef vec4_t quat_t; |
nuclear@28 | 24 |
nuclear@28 | 25 /* matrices */ |
nuclear@28 | 26 typedef scalar_t mat3_t[3][3]; |
nuclear@28 | 27 typedef scalar_t mat4_t[4][4]; |
nuclear@28 | 28 |
nuclear@28 | 29 |
nuclear@28 | 30 #ifdef __cplusplus |
nuclear@28 | 31 class Vector2; |
nuclear@28 | 32 class Vector3; |
nuclear@28 | 33 class Vector4; |
nuclear@28 | 34 class Quaternion; |
nuclear@28 | 35 class Matrix3x3; |
nuclear@28 | 36 class Matrix4x4; |
nuclear@28 | 37 class SphVector; |
nuclear@28 | 38 #endif /* __cplusplus */ |
nuclear@28 | 39 |
nuclear@28 | 40 #endif /* VMATH_TYPES_H_ */ |