Remove unnecessary switch from CLight constructor

This commit is contained in:
Phillip Stephens 2021-05-06 10:52:35 -07:00
parent 5e0604f101
commit 847211f81f
1 changed files with 1 additions and 23 deletions

View File

@ -62,29 +62,7 @@ CLight::CLight(const zeus::CVector3f& pos, const zeus::CVector3f& dir, const zeu
CLight::CLight(ELightType type, const zeus::CVector3f& pos, const zeus::CVector3f& dir, const zeus::CColor& color, CLight::CLight(ELightType type, const zeus::CVector3f& pos, const zeus::CVector3f& dir, const zeus::CColor& color,
float cutoff) float cutoff)
: x0_pos(pos) : x0_pos(pos), xc_dir(dir), x18_color(color), x1c_type(type), x20_spotCutoff(cutoff) {}
, xc_dir(dir)
, x18_color(color)
, x1c_type(type)
, x20_spotCutoff(cutoff) {
switch (type) {
case ELightType::Spot: {
const float cosCutoff = std::cos(zeus::degToRad(cutoff));
x30_angleC = 0.f;
x34_angleL = -cosCutoff / (1.0f - cosCutoff);
x38_angleQ = 1.f / (1.0f - cosCutoff);
break;
}
case ELightType::Directional: {
x24_distC = 1.f;
x28_distL = 0.f;
x2c_distQ = 0.f;
break;
}
default:
break;
}
}
zeus::CColor CLight::GetNormalIndependentLightingAtPoint(const zeus::CVector3f& point) const { zeus::CColor CLight::GetNormalIndependentLightingAtPoint(const zeus::CVector3f& point) const {
if (x1c_type == ELightType::LocalAmbient) if (x1c_type == ELightType::LocalAmbient)