mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-09 16:45:46 -07:00
Fix animation cosine phase-shifted sampling
This commit is contained in:
parent
8257066e9e
commit
4a4f6e0d71
1 changed files with 2 additions and 2 deletions
|
|
@ -197,8 +197,8 @@ class plugin : Plugin() {
|
|||
val currentTime = System.currentTimeMillis()
|
||||
var animWeight = (currentTime - globe.timestamp).toFloat() / Constants.GLOBE_LIFETIME
|
||||
animWeight = clamp(animWeight, 0.0F, 1.0F)
|
||||
// sample cosine for the text pulse animation effect (cosine offset is to respect number of pulses)
|
||||
var pulseWeight = cos(animWeight * (PI + PI * 2 * Constants.GLOBE_TEXT_PULSES).toFloat())
|
||||
// sample cosine for the text pulse animation effect (cosine phase-shift is to respect number of pulses)
|
||||
var pulseWeight = cos(PI + animWeight * (PI * 2 * Constants.GLOBE_TEXT_PULSES).toFloat()).toFloat()
|
||||
pulseWeight = (pulseWeight + 1.0F) / 2.0F // map pulseWeight from [-1,1] to [0,1]
|
||||
val pulseIntensity = lerp(Constants.GLOBE_TEXT_PULSE_LOW, Constants.GLOBE_TEXT_PULSE_HIGH, pulseWeight)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue