Changeset 3597 for trunk/src/opengl/mesa/xform.h
- Timestamp:
- May 23, 2000, 10:35:01 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/xform.h
r2962 r3597 1 /* $Id: xform.h,v 1. 2 2000-03-01 18:49:41jeroen Exp $ */1 /* $Id: xform.h,v 1.3 2000-05-23 20:35:00 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 35 35 #include "types.h" 36 36 37 #ifdef USE_X86_ASM 38 #define _XFORMAPI _ASMAPI 39 #define _XFORMAPIP _ASMAPIP 40 #else 41 #define _XFORMAPI 42 #define _XFORMAPIP * 43 #endif 37 44 38 45 /* 39 46 * Transform a point (column vector) by a matrix: Q = M * P 40 47 */ 41 #define TRANSFORM_POINT( Q, M, P ) 42 Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; 43 Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; 44 Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; 48 #define TRANSFORM_POINT( Q, M, P ) \ 49 Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; \ 50 Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; \ 51 Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; \ 45 52 Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3]; 46 53 47 54 48 #define TRANSFORM_POINT3( Q, M, P ) 49 Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12]; 50 Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13]; 51 Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14]; 55 #define TRANSFORM_POINT3( Q, M, P ) \ 56 Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12]; \ 57 Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13]; \ 58 Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14]; \ 52 59 Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15]; 53 60 … … 56 63 * Transform a normal (row vector) by a matrix: [NX NY NZ] = N * MAT 57 64 */ 58 #define TRANSFORM_NORMAL( TO, N, MAT ) 59 do { 60 TO[0] = N[0] * MAT[0] + N[1] * MAT[1] + N[2] * MAT[2]; 61 TO[1] = N[0] * MAT[4] + N[1] * MAT[5] + N[2] * MAT[6]; 62 TO[2] = N[0] * MAT[8] + N[1] * MAT[9] + N[2] * MAT[10]; 65 #define TRANSFORM_NORMAL( TO, N, MAT ) \ 66 do { \ 67 TO[0] = N[0] * MAT[0] + N[1] * MAT[1] + N[2] * MAT[2]; \ 68 TO[1] = N[0] * MAT[4] + N[1] * MAT[5] + N[2] * MAT[6]; \ 69 TO[2] = N[0] * MAT[8] + N[1] * MAT[9] + N[2] * MAT[10]; \ 63 70 } while (0) 64 71 65 72 66 73 extern void gl_transform_vector( GLfloat u[4], 67 74 const GLfloat v[4], 68 75 const GLfloat m[16] ); 69 76 … … 104 111 * automatically available. 105 112 */ 106 typedef GLvector4f * (* __cdeclclip_func)( GLvector4f *vClip,113 typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip, 107 114 GLvector4f *vProj, 108 115 GLubyte clipMask[], 109 116 GLubyte *orMask, 110 117 GLubyte *andMask ); 111 112 118 113 119 typedef void (*dotprod_func)( GLvector4f *out_vec, … … 129 135 * parameter, to allow a unified interface. 130 136 */ 131 typedef void ( * __cdecltransform_func)( GLvector4f *to_vec,137 typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec, 132 138 const GLmatrix *mat, 133 139 const GLvector4f *from_vec, … … 141 147 extern void gl_transform_bounds3( GLubyte *orMask, GLubyte *andMask, 142 148 const GLmatrix *mat, 143 149 CONST GLfloat src[][3] ); 144 150 145 151 extern void gl_transform_bounds2( GLubyte *orMask, GLubyte *andMask, 146 147 152 const GLmatrix *mat, 153 CONST GLfloat src[][3] ); 148 154 149 155 … … 160 166 161 167 extern void gl_transform_point_sz( GLfloat Q[4], const GLfloat M[16], 162 168 const GLfloat P[4], GLuint sz ); 163 169 164 170 … … 169 175 #define Transform( to, mat, from, mask, cull ) \ 170 176 ( (*gl_transform_tab[cull!=0][(from)->size][(mat)->type])( to, mat, from, mask, cull ), \ 171 177 (to) ) 172 178 173 179
Note:
See TracChangeset
for help on using the changeset viewer.