core  array_cache  math  swrast  swrast_setup  tnl  tnl_dd 
Main Page   Data Structures   File List   Data Fields   Globals  

t_vb_cliptmp.h File Reference


Defines

#define CLIP_DOTPROD(K, A, B, C, D)   X(K)*A + Y(K)*B + Z(K)*C + W(K)*D
#define POLY_CLIP(PLANE, A, B, C, D)
#define LINE_CLIP(PLANE, A, B, C, D)

Functions

INLINE void TAG (clip_line)(GLcontext *ctx

Variables

INLINE void GLuint i
INLINE void GLuint GLuint j

Define Documentation

#define CLIP_DOTPROD K,
A,
B,
C,
     X(K)*A + Y(K)*B + Z(K)*C + W(K)*D
 

#define LINE_CLIP PLANE,
A,
B,
C,
 
 

Value:

do {                                                                    \
   if (mask & PLANE) {                                                  \
      GLfloat dpI = CLIP_DOTPROD( ii, A, B, C, D );                     \
      GLfloat dpJ = CLIP_DOTPROD( jj, A, B, C, D );                     \
                                                                        \
      if (DIFFERENT_SIGNS(dpI, dpJ)) {                                  \
         GLuint newvert = VB->LastClipped++;                            \
         VB->ClipMask[newvert] = 0;                                     \
         if (IS_NEGATIVE(dpJ)) {                                        \
            GLfloat t = dpI / (dpI - dpJ);                              \
            VB->ClipMask[jj] |= PLANE;                                  \
            INTERP_4F( t, coord[newvert], coord[ii], coord[jj] );       \
            interp( ctx, t, newvert, ii, jj, GL_FALSE );                \
            jj = newvert;                                               \
         } else {                                                       \
            GLfloat t = dpJ / (dpJ - dpI);                              \
            VB->ClipMask[ii] |= PLANE;                                  \
            INTERP_4F( t, coord[newvert], coord[jj], coord[ii] );       \
            interp( ctx, t, newvert, jj, ii, GL_FALSE );                \
            ii = newvert;                                               \
         }                                                              \
      }                                                                 \
      else if (IS_NEGATIVE(dpI))                                        \
         return;                                                        \
  }                                                                     \
} while (0)

#define POLY_CLIP PLANE,
A,
B,
C,
 
 


Function Documentation

INLINE void TAG clip_line    [static]
 


Variable Documentation

INLINE void GLuint i
 

INLINE void GLuint GLuint j
 


Generated on Sun May 16 15:55:27 2004 for Mesa Transform and Lighting (tnl) by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001