#include "qbsp.h"
Include dependency graph for brush_primit.c:

Go to the source code of this file.
Functions | |
| void | ComputeAxisBase (vec3_t normal, vec3_t texX, vec3_t texY) |
Variables | |
| int | g_bBrushPrimit |
|
||||||||||||||||
|
Definition at line 31 of file brush_primit.c. 00032 {
00033 vec_t RotY,RotZ;
00034 // do some cleaning
00035 if (fabs(normal[0])<1e-6)
00036 normal[0]=0.0f;
00037 if (fabs(normal[1])<1e-6)
00038 normal[1]=0.0f;
00039 if (fabs(normal[2])<1e-6)
00040 normal[2]=0.0f;
00041 // compute the two rotations around Y and Z to rotate X to normal
00042 RotY=-atan2(normal[2],sqrt(normal[1]*normal[1]+normal[0]*normal[0]));
00043 RotZ=atan2(normal[1],normal[0]);
00044 // rotate (0,1,0) and (0,0,1) to compute texX and texY
00045 texX[0]=-sin(RotZ);
00046 texX[1]=cos(RotZ);
00047 texX[2]=0;
00048 // the texY vector is along -Z ( T texture coorinates axis )
00049 texY[0]=-sin(RotY)*cos(RotZ);
00050 texY[1]=-sin(RotY)*sin(RotZ);
00051 texY[2]=-cos(RotY);
00052 }
|
|
|
Definition at line 26 of file brush_primit.c. Referenced by ChopFaceByBrush(), DrawSurfaceForSide(), LoadMapFile(), ParseMapEntity(), ParsePatch(), and ParseRawBrush(). |
1.3.9.1