port from perforce
This commit is contained in:
23
aiwaz/AiwazAnimator/Animations/CosineAnimation.cs
Normal file
23
aiwaz/AiwazAnimator/Animations/CosineAnimation.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace AiwazAnimator.Animations
|
||||
{
|
||||
class CosineAnimation
|
||||
: Animation
|
||||
{
|
||||
public CosineAnimation()
|
||||
: base()
|
||||
{
|
||||
AnimationName = "Cosine";
|
||||
}
|
||||
|
||||
protected override float Calculate(float NormalizedTime)
|
||||
{
|
||||
float Interpolant = (float)((1.0 - Math.Cos(NormalizedTime * Math.PI)) / 2.0);
|
||||
return (StartValue * (1.0f - Interpolant) + EndValue * Interpolant);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user