2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 03:47:43 +00:00

Implement CActorLights::BuildAreaLightList

This commit is contained in:
Jack Andersen
2017-04-09 20:57:00 -10:00
parent 9cd421888d
commit 84578e9909
20 changed files with 477 additions and 127 deletions

View File

@@ -86,6 +86,15 @@ CLight::CLight(ELightType type,
}
}
zeus::CColor CLight::GetNormalIndependentLightingAtPoint(const zeus::CVector3f& point) const
{
if (x1c_type == ELightType::LocalAmbient)
return x18_color;
float dist = std::max((x0_pos - point).magnitude(), FLT_EPSILON);
return x18_color * (1.f / (x2c_distQ * dist * dist + x28_distL * dist + x24_distC));
}
CLight CLight::BuildDirectional(const zeus::CVector3f& dir, const zeus::CColor& color)
{
return CLight(ELightType::Directional, kDefaultPosition, dir, color, 180.f);