[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5150: file_get_contents(https://freedomsponsors.org/api/project/294): failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway
Tweening - Forums | Torque 3D

Tweening

Scripts and code that enhance the gameplay functionality of the engine.
25 posts Page 1 of 3
LukasPJ
Site Admin
Posts: 318
Joined: Tue Feb 03, 2015 7:25 pm
 
  by LukasPJ » Tue Feb 17, 2015 1:25 am
Hey guys, I wrote a Tweening class for Torque3D that can be found here.

It's pretty simple to use:
%tween = new Tween(){
Duration = 5; // This is in seconds.
Target = SimpleWall; // Any SimObject.
ValueName = "x"; // Syntactic sugar for the x-coordinate.
ValueTarget = "5"; // The destination value, this is the absolute value. No relative supported atm.
EaseDirection = $Ease::Out; // This is just the stock easing values.
EaseType = $Ease::Circular; // Again, this is a stock thing, I didn't implement the $Ease enum.
};

%tween.play();


There is syntactic sugar for:
Position (x, y, z).
Rotation(rx, ry, rz).
Scale(sx, sy, sz).

But any numerical field that is accessible through TorqueScript can be used. (Includes globals).

The Tween class has the following methods:
  • Play - Starts the tween
  • Pause - Pauses the tween
  • Rewind - Rewinds the tween back to the beginning (does not stop it currently)
  • Reverse - Plays the tween in reverse

And an "onFinished" callback.

The code is not completely finished, but it's fun to play with!
rlranft
Posts: 298
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Tue Feb 17, 2015 5:52 am
Nice - I snagged Charlie's Twillex stuff from T2D, but so far all I've used it for is some GUI stuff....
Steve_Yorkshire
Posts: 191
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Tue Feb 17, 2015 5:18 pm
Tweening? What the hell is tweening!?
There some old TorqueScript for moving stuff around in the old library.cs file that I remember using once.
LukasPJ
Site Admin
Posts: 318
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Tue Feb 17, 2015 5:46 pm
Steve_Yorkshire wrote:Tweening? What the hell is tweening!?
There some old TorqueScript for moving stuff around in the old library.cs file that I remember using once.


This can do more than just move stuff around! (Also library.cs? What file is that? :P)

For example you could change its scale so it would get wider over time :P Or rotate it in weird ways. It's basically a C++ version of Twillex
Steve_Yorkshire
Posts: 191
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Tue Feb 17, 2015 6:22 pm
@
User avatar
LukasPJ

Twillex? I thought that was a dubstep DJ or someone ...

Library.cs is an ancient file or TorqueScript which predates the Phanerozoic Era by half a billion years. It's full of fancy script utilities and mathematics before TGE had them integrated into C++ and the like.
http://yorkshirerifles.com/downloads/library.cs
rlranft
Posts: 298
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Tue Feb 17, 2015 7:28 pm
"Tweening" - from "in between keyframes," it means to draw the animation frames between the keys provided - or "inbetweening." See http://en.wikipedia.org/wiki/Inbetweening

Twillex - Scripts to aid simple animation sequences in T2D. See http://www.garagegames.com/community/blogs/view/21480
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Thu Feb 19, 2015 11:44 am
I've been using Twillex and it's pretty great, though I noticed that it doesn't look at all smooth in T3D unless you do this (i.e. use ScriptTickObject and its callback).
LukasPJ
Site Admin
Posts: 318
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Thu Feb 19, 2015 12:39 pm
buckmaster wrote:I've been using Twillex and it's pretty great, though I noticed that it doesn't look at all smooth in T3D unless you do this (i.e. use ScriptTickObject and its callback).

This is a C++ version of Twillex so it's pretty smooth already :P
RichardM
Posts: 32
Joined: Tue Feb 10, 2015 10:23 pm
 
by RichardM » Thu Feb 19, 2015 3:22 pm
Nice!
rlranft
Posts: 298
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Thu Feb 19, 2015 4:14 pm
buckmaster wrote:I've been using Twillex and it's pretty great, though I noticed that it doesn't look at all smooth in T3D unless you do this (i.e. use ScriptTickObject and its callback).

It worked fine for simple GUI object movement - I made roll-out button panels that sit on the edges of the screen. I'll have to upload a short video later.
I've been contemplating translating this to C++ myself. It's a natural progression and as Daniel points out it's a better overall solution for T3D.
25 posts Page 1 of 3

Who is online

Users browsing this forum: No registered users and 1 guest