mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Corrects light animation to adhere to the brightness level set in the light's params instead of sticking with the default 0-1 brightness range.
This commit is contained in:
parent
82bafd9f35
commit
6e1d031ecd
1 changed files with 3 additions and 2 deletions
|
|
@ -195,6 +195,7 @@ bool LightAnimData::AnimValue<COUNT>::animate( F32 time, F32 *output )
|
|||
F32 scaledTime, lerpFactor, valueRange, keyFrameLerp;
|
||||
U32 posFrom, posTo;
|
||||
S32 keyFrameFrom, keyFrameTo;
|
||||
F32 initialValue = *output;
|
||||
|
||||
bool wasAnimated = false;
|
||||
|
||||
|
|
@ -215,13 +216,13 @@ bool LightAnimData::AnimValue<COUNT>::animate( F32 time, F32 *output )
|
|||
valueRange = ( value2[i] - value1[i] ) / 25.0f;
|
||||
|
||||
if ( !smooth[i] )
|
||||
output[i] = value1[i] + ( keyFrameFrom * valueRange );
|
||||
output[i] = (value1[i] + (keyFrameFrom * valueRange)) * initialValue;
|
||||
else
|
||||
{
|
||||
lerpFactor = scaledTime - posFrom;
|
||||
keyFrameLerp = ( keyFrameTo - keyFrameFrom ) * lerpFactor;
|
||||
|
||||
output[i] = value1[i] + ( ( keyFrameFrom + keyFrameLerp ) * valueRange );
|
||||
output[i] = (value1[i] + ((keyFrameFrom + keyFrameLerp) * valueRange)) * initialValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue