Fixed Point Arithmetic  0
Fixed-point math library.
vector_types.h
Go to the documentation of this file.
1 
37 #ifndef FIXED_POINT_VECTOR_T_H
38 #define FIXED_POINT_VECTOR_T_H
39 
40 #include "types.h"
41 
52 typedef struct {
53  mfrac x,y,z;
54 } mvec3;
55 
61 typedef struct {
62  frac x,y,z;
63 } vec3;
64 
70 typedef struct {
71  dfrac x,y,z;
72 } dvec3;
73 
79 typedef struct {
80  efrac x,y,z;
81 } evec3;
82 
84 #define VEC0 {{0},{0},{0}}
85 
86 static const mvec3 mvec3_Zero = VEC0;
87 static const vec3 vec3_Zero = VEC0;
88 static const dvec3 dvec3_Zero = VEC0;
89 static const evec3 evec3_Zero = VEC0;
95 
101 #if (FRAC_BIT == 16)
102 
103 typedef vec3 vec3_s16;
104 #endif
105 
106 #if (DFRAC_BIT == 32)
107 
108 typedef dvec3 vec3_s32;
109 #endif
110 
117 #endif /* FIXED_POINT_VECTOR_T_H */
Type definitions for fixed point arithmetic types.
16 bit fractional number in Q8.8 format.
Definition: types.h:76
#define VEC0
Literal for the Zero vector.
Definition: vector_types.h:84
Mixed integer/fractional 3D vector.
Definition: vector_types.h:52
dvec3 vec3_s32
3d vector with 32 bit signed components
Definition: vector_types.h:108
efrac z
Definition: vector_types.h:80
frac z
Definition: vector_types.h:62
32 bit fractional number in Q2.30 format.
Definition: types.h:99
Double precision 3D vector.
Definition: vector_types.h:70
vec3 vec3_s16
3d vector with 16 bit signed components.
Definition: vector_types.h:103
16 bit fractional number in Q1.15 format.
Definition: types.h:86
dfrac z
Definition: vector_types.h:71
vec_axis
This type is used to indicate the axis.
Definition: vector_types.h:94
Extended precision 3D vector.
Definition: vector_types.h:79
mfrac z
Definition: vector_types.h:53
Single precision 3D vector.
Definition: vector_types.h:61
32 bit fractional number in Q17.15 format.
Definition: types.h:112