5 extern vec_t softwaretransform_rotatematrix[3][4];
6 extern vec_t softwaretransform_matrix[3][4];
7 extern vec_t softwaretransform_invmatrix[3][4];
8 extern int softwaretransform_complexity;
10 void softwaretransformidentity (void);
11 void softwaretransformset (vec3_t origin, vec3_t angles, vec_t scale);
12 void softwaretransformforentity (entity_render_t *r);
14 // #defines for speed reasons
15 #define softwaretransform(in, out)\
17 if (softwaretransform_complexity == 0)\
21 else if (softwaretransform_complexity == 1)\
23 out[0] = in[0] + softwaretransform_matrix[0][3];\
24 out[1] = in[1] + softwaretransform_matrix[1][3];\
25 out[2] = in[2] + softwaretransform_matrix[2][3];\
29 out[0] = DotProduct(in, softwaretransform_matrix[0]) + softwaretransform_matrix[0][3];\
30 out[1] = DotProduct(in, softwaretransform_matrix[1]) + softwaretransform_matrix[1][3];\
31 out[2] = DotProduct(in, softwaretransform_matrix[2]) + softwaretransform_matrix[2][3];\
35 #define softwaretransformdirection(in, out)\
37 if (softwaretransform_complexity == 2)\
39 out[0] = DotProduct(in, softwaretransform_rotatematrix[0]);\
40 out[1] = DotProduct(in, softwaretransform_rotatematrix[1]);\
41 out[2] = DotProduct(in, softwaretransform_rotatematrix[2]);\
47 #define softwareuntransform(in, out)\
49 if (softwaretransform_complexity == 0)\
53 else if (softwaretransform_complexity == 1)\
55 out[0] = in[0] - softwaretransform_invmatrix[0][3];\
56 out[1] = in[1] - softwaretransform_invmatrix[1][3];\
57 out[2] = in[2] - softwaretransform_invmatrix[2][3];\
62 soft_v[0] = in[0] - softwaretransform_invmatrix[0][3];\
63 soft_v[1] = in[1] - softwaretransform_invmatrix[1][3];\
64 soft_v[2] = in[2] - softwaretransform_invmatrix[2][3];\
65 out[0] = DotProduct(soft_v, softwaretransform_invmatrix[0]);\
66 out[1] = DotProduct(soft_v, softwaretransform_invmatrix[1]);\
67 out[2] = DotProduct(soft_v, softwaretransform_invmatrix[2]);\