A tweening controller with schedule()
by Alex Rice · in Torque Game Builder · 09/29/2005 (10:26 pm) · 3 replies
Has anything like this been done and released as a resource? Seems like a very common thing that torquescript developers would need to do:
A controller class for schedule() usage. It would be passed an object, a method, a parameter, start value, finish value, duration and other flags like linear, smooth, ease-in, ease-out, etc. This could be used to do tweening of parameters that are controlled by script. Something like
I got this idea from XSI. In XSI, and probably other high-end 3D apps, every parameter of every object is animatable by script expression, and by GUI sliders etc.. This combined with a nice fcurve editor and animation clip/mixer means that *anything* in an XSI scene can be animated.
I was trying to think of how to apply that "animate anything" idea to torquescript, since T2D doesn't have any tweening or animation of parameters, e.g. shape, color, size, position, etc. Well it has physics simulation of course, but that's not the same as animating arbitrary parameters of an object- which may or may not have anything to do with physics at all.
A controller class for schedule() usage. It would be passed an object, a method, a parameter, start value, finish value, duration and other flags like linear, smooth, ease-in, ease-out, etc. This could be used to do tweening of parameters that are controlled by script. Something like
function myCls::doSomething( %this, %pValue ) { ... }
$obj = new MyCls();
$c = new ScheduleController();
$c.setObject( $obj );
$c.setMethod( "doSomething" );
$c.addParameter( 5, 50 ); // start at 5 -> finish at 50
$c.setDuration( 1000 ); // ms
$c.setInterp( "EASE_IN" ); // adjust curve
$c.run();
// now over next 1 sec, $obj.doSomething() will get called
// with consecutiy from 5 to 50, skipping values and tweaking the
// delay between calls, to acheive the desired effect.I got this idea from XSI. In XSI, and probably other high-end 3D apps, every parameter of every object is animatable by script expression, and by GUI sliders etc.. This combined with a nice fcurve editor and animation clip/mixer means that *anything* in an XSI scene can be animated.
I was trying to think of how to apply that "animate anything" idea to torquescript, since T2D doesn't have any tweening or animation of parameters, e.g. shape, color, size, position, etc. Well it has physics simulation of course, but that's not the same as animating arbitrary parameters of an object- which may or may not have anything to do with physics at all.
About the author
#2
09/29/2005 (11:28 pm)
This could be nifty, and I'd definitely be interested in a TS-centric thing like this, 'specially since I'm currently steering away from touching the source code, at least for the time being.
#3
http://www.garagegames.com/mg/forums/result.thread.php?qt=29529
10/01/2005 (10:36 am)
Well, it's old and buggy but maybe you can use it to create something more generalized and better.http://www.garagegames.com/mg/forums/result.thread.php?qt=29529
Torque Owner Alex Rice
Default Studio Name