[Patchanim-commit] SF.net SVN: patchanim:[268] trunk/patchanim/src/com/mebigfatguy/patchanim/ Tween
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-12-28 06:27:32
|
Revision: 268
http://patchanim.svn.sourceforge.net/patchanim/?rev=268&view=rev
Author: dbrosius
Date: 2008-12-28 06:27:30 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
simplify tweenstyle algos
Modified Paths:
--------------
trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java
Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java
===================================================================
--- trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java 2008-12-28 06:25:42 UTC (rev 267)
+++ trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java 2008-12-28 06:27:30 UTC (rev 268)
@@ -35,10 +35,10 @@
* </ul>
*/
public enum TweenStyle {
- Linear(0, 1.0/3.0, 2.0/3.0, 1),
+ Linear(0, 1),
Accelerating(0, 0, 0, 1),
Decelerating(0, 1, 1, 1),
- EaseInEaseOut(0, 0.0, 1, 1),
+ EaseInEaseOut(0, 0, 1, 1),
AccelerateInAccelerateOut(0, 1, 0, 1),
Wave(0, 2, -1, 1);
@@ -49,13 +49,13 @@
private TweenStyle(double... ys) {
this.ys = ys;
- coeffs = new double[4];
+ coeffs = new double[ys.length];
}
public double transform(double frac) {
PatchGenerator.buildCoefficients(frac, coeffs);
double out = 0.0;
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < ys.length; i++) {
out += coeffs[i] * ys[i];
}
return out;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|