Ignore:
Timestamp:
May 23, 2000, 10:35:01 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

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:41 jeroen Exp $ */
     1/* $Id: xform.h,v 1.3 2000-05-23 20:35:00 jeroen Exp $ */
    22
    33/*
    44 * Mesa 3-D graphics library
    5  * Version:  3.1
     5 * Version:  3.3
    66 *
    77 * Copyright (C) 1999  Brian Paul   All Rights Reserved.
     
    3535#include "types.h"
    3636
     37#ifdef USE_X86_ASM
     38#define _XFORMAPI _ASMAPI
     39#define _XFORMAPIP _ASMAPIP
     40#else
     41#define _XFORMAPI
     42#define _XFORMAPIP *
     43#endif
    3744
    3845/*
    3946 * Transform a point (column vector) by a matrix:   Q = M * P
    4047 */
    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];      \
    4552   Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3];
    4653
    4754
    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];     \
    5259   Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15];
    5360
     
    5663 * Transform a normal (row vector) by a matrix:  [NX NY NZ] = N * MAT
    5764 */
    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 )                          \
     66do {                                                            \
     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];      \
    6370} while (0)
    6471
    6572
    6673extern void gl_transform_vector( GLfloat u[4],
    67                                 const GLfloat v[4],
     74                                const GLfloat v[4],
    6875                                 const GLfloat m[16] );
    6976
     
    104111 * automatically available.
    105112 */
    106 typedef GLvector4f *(* __cdecl clip_func)( GLvector4f *vClip,
     113typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip,
    107114                                  GLvector4f *vProj,
    108115                                  GLubyte clipMask[],
    109116                                  GLubyte *orMask,
    110117                                  GLubyte *andMask );
    111 
    112118
    113119typedef void (*dotprod_func)( GLvector4f *out_vec,
     
    129135 *     parameter, to allow a unified interface.
    130136 */
    131 typedef void (* __cdecl transform_func)( GLvector4f *to_vec,
     137typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec,
    132138                                const GLmatrix *mat,
    133139                                const GLvector4f *from_vec,
     
    141147extern void gl_transform_bounds3( GLubyte *orMask, GLubyte *andMask,
    142148                           const GLmatrix *mat,
    143                            CONST GLfloat src[][3] );
     149                           CONST GLfloat src[][3] );
    144150
    145151extern void gl_transform_bounds2( GLubyte *orMask, GLubyte *andMask,
    146                            const GLmatrix *mat,
    147                            CONST GLfloat src[][3] );
     152                           const GLmatrix *mat,
     153                           CONST GLfloat src[][3] );
    148154
    149155
     
    160166
    161167extern void gl_transform_point_sz( GLfloat Q[4], const GLfloat M[16],
    162                                    const GLfloat P[4], GLuint sz );
     168                                   const GLfloat P[4], GLuint sz );
    163169
    164170
     
    169175#define Transform( to, mat, from, mask, cull ) \
    170176      ( (*gl_transform_tab[cull!=0][(from)->size][(mat)->type])( to, mat, from, mask, cull ), \
    171         (to) )
     177        (to) )
    172178
    173179
Note: See TracChangeset for help on using the changeset viewer.