28 #include "../idlib/precompiled.h"
59 bounds[0][0] = bounds[0][1] = 999999;
60 bounds[1][0] = bounds[1][1] = -999999;
61 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
62 for ( j = 0 ; j < 2 ; j++ ) {
64 if ( v < bounds[0][j] ) {
67 if ( v > bounds[1][j] ) {
76 boundsOrg[0] = floor( ( bounds[0][0] + bounds[1][0] ) * 0.5 );
77 boundsOrg[1] = floor( ( bounds[0][1] + bounds[1][1] ) * 0.5 );
86 d0[3] = b->
st[0] - a->
st[0];
87 d0[4] = b->
st[1] - a->
st[1];
89 d1[3] = c->
st[0] - a->
st[0];
90 d1[4] = c->
st[1] - a->
st[1];
92 area = d0[3] * d1[4] - d0[4] * d1[3];
101 axis[0][0] = (d0[0] * d1[4] - d0[4] * d1[0]) * inva;
102 axis[0][1] = (d0[1] * d1[4] - d0[4] * d1[1]) * inva;
103 axis[0][2] = (d0[2] * d1[4] - d0[4] * d1[2]) * inva;
105 axis[1][0] = (d0[3] * d1[0] - d0[0] * d1[3]) * inva;
106 axis[1][1] = (d0[3] * d1[1] - d0[1] * d1[3]) * inva;
107 axis[1][2] = (d0[3] * d1[2] - d0[2] * d1[3]) * inva;
111 axis[2][0] = plane[0];
112 axis[2][1] = plane[1];
113 axis[2][2] = plane[2];
116 VectorMA( a->
xyz, boundsOrg[0] - a->
st[0], axis[0], origin );
117 VectorMA( origin, boundsOrg[1] - a->
st[1], axis[1], origin );
146 float guiModelMatrix[16];
147 float modelMatrix[16];
149 guiModelMatrix[0] = axis[0][0] / 640.0;
150 guiModelMatrix[4] = axis[1][0] / 480.0;
151 guiModelMatrix[8] = axis[2][0];
152 guiModelMatrix[12] = origin[0];
154 guiModelMatrix[1] = axis[0][1] / 640.0;
155 guiModelMatrix[5] = axis[1][1] / 480.0;
156 guiModelMatrix[9] = axis[2][1];
157 guiModelMatrix[13] = origin[1];
159 guiModelMatrix[2] = axis[0][2] / 640.0;
160 guiModelMatrix[6] = axis[1][2] / 480.0;
161 guiModelMatrix[10] = axis[2][2];
162 guiModelMatrix[14] = origin[2];
164 guiModelMatrix[3] = 0;
165 guiModelMatrix[7] = 0;
166 guiModelMatrix[11] = 0;
167 guiModelMatrix[15] = 1;
205 common->
Printf(
"Checking for changed gui files...\n" );
const srfTriangles_t * geo
bool FromPoints(const idVec3 &p1, const idVec3 &p2, const idVec3 &p3, bool fixDegenerate=true)
class idGuiModel * guiModel
#define VectorSubtract(a, b, c)
void R_SurfaceToTextureAxis(const srfTriangles_t *tri, idVec3 &origin, idVec3 axis[3])
void R_ListGuis_f(const idCmdArgs &args)
void EmitToCurrentView(float modelMatrix[16], bool depthHack)
const struct viewEntity_s * space
idUserInterfaceManager * uiManager
int Icmp(const char *text) const
idCVar r_skipGuiShaders("r_skipGuiShaders","0", CVAR_RENDERER|CVAR_INTEGER,"1 = skip all gui elements on surfaces, 2 = skip drawing but still handle events, 3 = draw but skip events", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
int GetInteger(void) const
virtual void Redraw(int time)=0
virtual void ListGuis() const =0
GLubyte GLubyte GLubyte a
virtual void Printf(const char *fmt,...) id_attribute((format(printf
void myGlMultMatrix(const float *a, const float *b, float *out)
virtual void Reload(bool all)=0
void R_RenderGuiSurf(idUserInterface *gui, drawSurf_t *drawSurf)
const char * Argv(int arg) const
void R_ReloadGuis_f(const idCmdArgs &args)
#define VectorMA(v, s, b, o)