From 9f3092e63ac7c17dd314d3d19f73e68538066765 Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Tue, 4 Dec 2007 19:22:21 +0000 Subject: [PATCH] Let our functions escape the bondage of integers and vary freely with time. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@364 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flash/path/HermiteFunc.as | 10 +++++----- src/as/com/threerings/flash/path/InterpFunc.as | 2 +- src/as/com/threerings/flash/path/LinearFunc.as | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/as/com/threerings/flash/path/HermiteFunc.as b/src/as/com/threerings/flash/path/HermiteFunc.as index ad26a678..fc3fab02 100644 --- a/src/as/com/threerings/flash/path/HermiteFunc.as +++ b/src/as/com/threerings/flash/path/HermiteFunc.as @@ -36,7 +36,7 @@ public class HermiteFunc extends InterpFunc } // from InterpFunc - override public function getValue (t :Number) :int + override public function getValue (t :Number) :Number { if (t >= 1) { return _p1; @@ -46,10 +46,10 @@ public class HermiteFunc extends InterpFunc var tt :Number = t*t; var ttt :Number = tt * t; - return int(_p0 * (2*ttt - 3*tt + 1) + - _m0 * (ttt - 2*tt + t) + - _p1 * (-2*ttt + 3*tt) + - _m1 * (ttt - tt)); + return _p0 * (2*ttt - 3*tt + 1) + + _m0 * (ttt - 2*tt + t) + + _p1 * (-2*ttt + 3*tt) + + _m1 * (ttt - tt); } } diff --git a/src/as/com/threerings/flash/path/InterpFunc.as b/src/as/com/threerings/flash/path/InterpFunc.as index 84416820..f5ad4032 100644 --- a/src/as/com/threerings/flash/path/InterpFunc.as +++ b/src/as/com/threerings/flash/path/InterpFunc.as @@ -26,7 +26,7 @@ package com.threerings.flash.path { */ public /*abstract*/ class InterpFunc { - public /*abstract*/ function getValue (complete :Number) :int + public /*abstract*/ function getValue (complete :Number) :Number { throw new Error("abstract"); } diff --git a/src/as/com/threerings/flash/path/LinearFunc.as b/src/as/com/threerings/flash/path/LinearFunc.as index c31fb3dd..a57eb310 100644 --- a/src/as/com/threerings/flash/path/LinearFunc.as +++ b/src/as/com/threerings/flash/path/LinearFunc.as @@ -33,14 +33,14 @@ public class LinearFunc extends InterpFunc } // from InterpFunc - override public function getValue (complete :Number) :int + override public function getValue (complete :Number) :Number { if (complete >= 1) { return _end; } else if (complete < 0) { // cope with a funny startOffset return _start; } else { - return int((_end - _start) * complete) + _start; + return ((_end - _start) * complete) + _start; } }