- Added spot light support to gl_SetDynSpriteLight

This commit is contained in:
Magnus Norddahl 2018-01-04 19:27:03 +01:00
parent f398286162
commit bae3620540
2 changed files with 26 additions and 6 deletions

View file

@ -141,10 +141,10 @@ void gl_AddLightToList(int group, ADynamicLight * light, FDynLightData &ldata)
spotOuterAngle = light->SpotOuterAngle.Cos();
DAngle negPitch = -light->Angles.Pitch;
float xyLen = negPitch.Cos();
spotDirX = -light->Angles.Yaw.Cos() * xyLen;
spotDirY = -light->Angles.Yaw.Sin() * xyLen;
spotDirZ = -negPitch.Sin();
double xzLen = negPitch.Cos();
spotDirX = -light->Angles.Yaw.Cos() * xzLen;
spotDirY = -negPitch.Sin();
spotDirZ = -light->Angles.Yaw.Sin() * xzLen;
}
float *data = &ldata.arrays[i][ldata.arrays[i].Reserve(16)];