Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
◆ MAX_CLIP_VERTS
#define MAX_CLIP_VERTS 64 |
◆ ON_EPSILON
◆ SIDE_BACK
◆ SIDE_FRONT
◆ SIDE_ON
◆ SKY_VISIBLE
#define SKY_VISIBLE |
( |
|
side | ) |
|
Value:
skymins[1][side] <
skymaxs[1][side])
Definition at line 328 of file sky.c.
◆ ClipSkyPolygon()
static void ClipSkyPolygon |
( |
int |
nump, |
|
|
vec3_t |
vecs, |
|
|
int |
stage |
|
) |
| |
|
static |
Definition at line 135 of file sky.c.
139 qboolean front, back;
148 Com_DPrintf(
"%s: too many verts\n", __func__);
158 front = back = qfalse;
160 for (i = 0, v = vecs; i < nump; i++, v += 3) {
161 d = DotProduct(v, norm);
174 if (!front || !back) {
183 VectorCopy(vecs, (vecs + (i * 3)));
184 newc[0] = newc[1] = 0;
186 for (i = 0, v = vecs; i < nump; i++, v += 3) {
189 VectorCopy(v, newv[0][newc[0]]);
193 VectorCopy(v, newv[1][newc[1]]);
197 VectorCopy(v, newv[0][newc[0]]);
199 VectorCopy(v, newv[1][newc[1]]);
204 if (sides[i] ==
SIDE_ON || sides[i + 1] ==
SIDE_ON || sides[i + 1] == sides[i])
207 d = dists[i] / (dists[i] - dists[i + 1]);
208 for (j = 0; j < 3; j++) {
209 e = v[j] + d * (v[j + 3] - v[j]);
210 newv[0][newc[0]][j] = e;
211 newv[1][newc[1]][j] = e;
Referenced by R_AddSkySurface().
◆ DrawSkyPolygon()
static void DrawSkyPolygon |
( |
int |
nump, |
|
|
vec3_t |
vecs |
|
) |
| |
|
static |
Definition at line 64 of file sky.c.
74 for (i = 0, vp = vecs; i < nump; i++, vp += 3) {
80 if (av[0] > av[1] && av[0] > av[2]) {
85 }
else if (av[1] > av[2] && av[1] > av[0]) {
98 for (i = 0; i < nump; i++, vecs += 3) {
108 s = -vecs[-j - 1] / dv;
110 s = vecs[j - 1] / dv;
113 t = -vecs[-j - 1] / dv;
115 t = vecs[j - 1] / dv;
Referenced by ClipSkyPolygon().
◆ MakeSkyVec()
static void MakeSkyVec |
( |
float |
s, |
|
|
float |
t, |
|
|
int |
axis, |
|
|
vec_t * |
out |
|
) |
| |
|
static |
Definition at line 286 of file sky.c.
295 for (j = 0; j < 3; j++) {
308 VectorAdd(v,
glr.
fd.vieworg, out);
Referenced by R_DrawSkyBox().
◆ R_AddSkySurface()
void R_AddSkySurface |
( |
mface_t * |
fa | ) |
|
Definition at line 234 of file sky.c.
239 msurfedge_t *surfedge;
243 Com_DPrintf(
"%s: too many verts\n", __func__);
248 surfedge = fa->firstsurfedge;
253 for (i = 0; i < fa->numsurfedges; i++, surfedge++) {
254 vert = surfedge->edge->v[surfedge->vert];
255 VectorSubtract(vert->point,
glr.
fd.vieworg, temp);
259 for (i = 0; i < fa->numsurfedges; i++, surfedge++) {
260 vert = surfedge->edge->v[surfedge->vert];
261 VectorSubtract(vert->point,
glr.
fd.vieworg, verts[i]);
Referenced by GL_DrawNode().
◆ R_ClearSkyBox()
◆ R_DrawSkyBox()
Definition at line 337 of file sky.c.
339 static const int skytexorder[6] = {0, 2, 1, 3, 4, 5};
352 for (i = 0; i < 6; i++) {
Referenced by GL_DrawWorld().
◆ R_SetSky_GL()
void R_SetSky_GL |
( |
const char * |
name, |
|
|
float |
rotate, |
|
|
vec3_t |
axis |
|
) |
| |
Definition at line 382 of file sky.c.
385 char pathname[MAX_QPATH];
389 static const char suf[6][3] = {
"rt",
"bk",
"lf",
"ft",
"up",
"dn" };
399 for (i = 0; i < 6; i++) {
400 len =
Q_concat(pathname,
sizeof(pathname),
401 "env/", name, suf[i],
".tga", NULL);
402 if (len >=
sizeof(pathname)) {
407 image =
IMG_Find(pathname, IT_SKY, IF_NONE);
Referenced by R_RegisterFunctionsGL().
◆ R_UnsetSky()
◆ SkyInverseRotate()
static void SkyInverseRotate |
( |
vec3_t |
out, |
|
|
const vec3_t |
in |
|
) |
| |
|
inlinestatic |
◆ sky_images
◆ sky_max
const float sky_max = 511.0f / 512.0f |
|
static |
◆ sky_min
const float sky_min = 1.0f / 512.0f |
|
static |
◆ skyaxis
◆ skyclip
Initial value:= {
{ 1, 1, 0 },
{ 1, -1, 0 },
{ 0, -1, 1 },
{ 0, 1, 1 },
{ 1, 0, 1 },
{ -1, 0, 1 }
}
Definition at line 25 of file sky.c.
Referenced by ClipSkyPolygon().
◆ skyfaces
◆ skymatrix
◆ skymaxs
◆ skymins
◆ skyrotate
◆ st_to_vec
const int st_to_vec[6][3] |
|
static |
Initial value:= {
{ 3, -1, 2 },
{ -3, 1, 2 },
{ 1, 3, 2 },
{ -1, -3, 2 },
{ -2, -1, 3 },
{ 2, -1, -3 }
}
Definition at line 35 of file sky.c.
Referenced by MakeSkyVec().
◆ vec_to_st
const int vec_to_st[6][3] |
|
static |
Initial value:= {
{ -2, 3, 1 },
{ 2, 3, -1 },
{ 1, 3, 2 },
{ -1, 3, -2 },
{ -2, -1, 3 },
{ -2, 1, -3 }
}
Definition at line 47 of file sky.c.
Referenced by DrawSkyPolygon().
#define SKY_VISIBLE(side)
static float skymins[2][6]
static void MakeSkyVec(float s, float t, int axis, vec_t *out)
void GL_BindTexture(GLuint tmu, GLuint texnum)
static void R_UnsetSky(void)
static float skymaxs[2][6]
void GL_ArrayBits(glArrayBits_t bits)
struct glStatic_t::@11 world
static void SkyInverseRotate(vec3_t out, const vec3_t in)
static const int vec_to_st[6][3]
static void GL_TexCoordPointer(GLint size, GLsizei stride, const GLfloat *pointer)
void SetupRotationMatrix(vec3_t matrix[3], const vec3_t dir, float degrees)
vec_t VectorNormalize2(vec3_t v, vec3_t out)
image_t * IMG_Find(const char *name, imagetype_t type, imageflags_t flags)
static void GL_VertexPointer(GLint size, GLsizei stride, const GLfloat *pointer)
static vec3_t skymatrix[3]
static const float sky_min
static void DrawSkyPolygon(int nump, vec3_t vecs)
static const vec3_t skyclip[6]
static const float sky_max
size_t Q_concat(char *dest, size_t size,...)
void GL_StateBits(glStateBits_t bits)
size_t FS_NormalizePath(char *out, const char *in)
static const int st_to_vec[6][3]
static void ClipSkyPolygon(int nump, vec3_t vecs, int stage)