mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
alternate to https://github.com/GarageGames/Torque3D/pull/1602
This commit is contained in:
parent
6caafc9844
commit
ad613f2e82
2 changed files with 6 additions and 4 deletions
|
|
@ -190,13 +190,15 @@ void LightAnimData::AnimValue<COUNT>::updateKey()
|
||||||
}
|
}
|
||||||
|
|
||||||
template<U32 COUNT>
|
template<U32 COUNT>
|
||||||
bool LightAnimData::AnimValue<COUNT>::animate( F32 time, F32 *output )
|
bool LightAnimData::AnimValue<COUNT>::animate(F32 time, F32 *output, bool multiply)
|
||||||
{
|
{
|
||||||
F32 scaledTime, lerpFactor, valueRange, keyFrameLerp;
|
F32 scaledTime, lerpFactor, valueRange, keyFrameLerp;
|
||||||
U32 posFrom, posTo;
|
U32 posFrom, posTo;
|
||||||
S32 keyFrameFrom, keyFrameTo;
|
S32 keyFrameFrom, keyFrameTo;
|
||||||
F32 initialValue = *output;
|
F32 initialValue = *output;
|
||||||
|
if (!multiply)
|
||||||
|
initialValue = 1;
|
||||||
|
|
||||||
bool wasAnimated = false;
|
bool wasAnimated = false;
|
||||||
|
|
||||||
for ( U32 i=0; i < COUNT; i++ )
|
for ( U32 i=0; i < COUNT; i++ )
|
||||||
|
|
@ -305,6 +307,6 @@ void LightAnimData::animate( LightInfo *lightInfo, LightAnimState *state )
|
||||||
lightInfo->setColor( color );
|
lightInfo->setColor( color );
|
||||||
|
|
||||||
F32 brightness = state->brightness;
|
F32 brightness = state->brightness;
|
||||||
mBrightness.animate( time, &brightness );
|
mBrightness.animate( time, &brightness, true );
|
||||||
lightInfo->setBrightness( brightness );
|
lightInfo->setBrightness( brightness );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ public:
|
||||||
/// Performs the animation returning the results in the output if
|
/// Performs the animation returning the results in the output if
|
||||||
/// the time scale is greater than zero.
|
/// the time scale is greater than zero.
|
||||||
/// @return Returns true if the animation was performed.
|
/// @return Returns true if the animation was performed.
|
||||||
bool animate( F32 time, F32 *output );
|
bool animate(F32 time, F32 *output, bool multiply = false);
|
||||||
|
|
||||||
/// Called when the key string is changed to update the
|
/// Called when the key string is changed to update the
|
||||||
/// key length and time scale.
|
/// key length and time scale.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue