mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-02 23:32:09 +00:00
[client] Change location of sun vector negation
Moving the negation into the calculation of the sun angle prevents -0 getting into the vector (not that it makes much difference other than minor confusion when reading the light data).
This commit is contained in:
parent
cfe7064708
commit
54b6573470
1 changed files with 6 additions and 4 deletions
|
@ -91,10 +91,12 @@ static vec4f_t
|
||||||
sun_vector (const vec_t *ang)
|
sun_vector (const vec_t *ang)
|
||||||
{
|
{
|
||||||
// ang is yaw, pitch (maybe roll, but ignored
|
// ang is yaw, pitch (maybe roll, but ignored
|
||||||
|
// negative as the vector points *to* the sun, but ang specifies the
|
||||||
|
// direction from the sun
|
||||||
vec4f_t vec = {
|
vec4f_t vec = {
|
||||||
ecos (ang[1]) * ecos (ang[0]),
|
-ecos (ang[1]) * ecos (ang[0]),
|
||||||
ecos (ang[1]) * esin (ang[0]),
|
-ecos (ang[1]) * esin (ang[0]),
|
||||||
esin (ang[1]),
|
-esin (ang[1]),
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
return vec;
|
return vec;
|
||||||
|
@ -120,7 +122,7 @@ parse_sun (lightingdata_t *ldata, plitem_t *entity)
|
||||||
}
|
}
|
||||||
VectorSet (1, 1, 1, light.color);
|
VectorSet (1, 1, 1, light.color);
|
||||||
light.color[3] = sunlight;
|
light.color[3] = sunlight;
|
||||||
light.position = -sun_vector (sunangle);
|
light.position = sun_vector (sunangle);
|
||||||
light.direction = light.position;
|
light.direction = light.position;
|
||||||
light.direction[3] = 1;
|
light.direction[3] = 1;
|
||||||
light.attenuation = (vec4f_t) { 0, 0, 1, 0 };
|
light.attenuation = (vec4f_t) { 0, 0, 1, 0 };
|
||||||
|
|
Loading…
Reference in a new issue