mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-03 11:45:59 +00:00
CLight: Make CalculateSpotAngleAtten() const
This member function doesn't modify internal member state.
This commit is contained in:
parent
b439e4bba1
commit
f2201ca03c
@ -82,13 +82,14 @@ float CLight::CalculateIntensity() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// As is this one... partly
|
// As is this one... partly
|
||||||
CVector3f CLight::CalculateSpotAngleAtten()
|
CVector3f CLight::CalculateSpotAngleAtten() const
|
||||||
{
|
{
|
||||||
if (mType != ELightType::Spot) return CVector3f(1.f, 0.f, 0.f);
|
if (mType != ELightType::Spot)
|
||||||
|
return CVector3f(1.f, 0.f, 0.f);
|
||||||
|
|
||||||
float RadianCutoff = mSpotCutoff * (3.1415927f / 180.f);
|
const float RadianCutoff = mSpotCutoff * (3.1415927f / 180.f);
|
||||||
float RadianCosine = cosf(RadianCutoff);
|
const float RadianCosine = cosf(RadianCutoff);
|
||||||
float InvCosine = 1.f - RadianCosine;
|
const float InvCosine = 1.f - RadianCosine;
|
||||||
|
|
||||||
return CVector3f(0.f, -RadianCosine / InvCosine, 1.f / InvCosine);
|
return CVector3f(0.f, -RadianCosine / InvCosine, 1.f / InvCosine);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ private:
|
|||||||
// Data Manipulation
|
// Data Manipulation
|
||||||
float CalculateRadius() const;
|
float CalculateRadius() const;
|
||||||
float CalculateIntensity() const;
|
float CalculateIntensity() const;
|
||||||
CVector3f CalculateSpotAngleAtten();
|
CVector3f CalculateSpotAngleAtten() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Accessors
|
// Accessors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user