Moving Shapes Smoothly
by Dustin Williams · in Torque Game Engine · 12/07/2004 (11:40 am) · 7 replies
I want to use a while loop to move a shape. How do I do this? I know that I can use a getTransform/setTransform thing, but I don't know how to put this into a while loop. In 3DGS's WDL (A6) you did something like this:
the function wait waits one frame. Is there such a function in Torque? How the hell do simple frame-by-frame movement?
Thanks!
while(1) {
object.x += 1;
wait(1);
}the function wait waits one frame. Is there such a function in Torque? How the hell do simple frame-by-frame movement?
Thanks!
#2
12/09/2004 (9:09 am)
I want to us an equation to launch a cannon ball. I have looked around for resources, but I still don't understand how I'd do this in a while loop. Should I do this in C++? How do I do this C++ or script?
#3
12/09/2004 (9:11 am)
The Projectile class supports "ballicstic" trajectories (ie...an arc like a cannon ball). You can make a cannonball work without a loop at all...just create a type of gun that shoots a type of Projectile that has the "ballistic" flag set to true in the datablock.
#4
12/09/2004 (10:28 am)
That works. But I'm creating a physics simulation and I would like to write the code that controls the ball myself (it's for a science fair project). How would I do that?
#5
12/09/2004 (10:55 am)
Replace the ballistics code with your own code.
#6
12/09/2004 (11:05 am)
Where is the ballistics code?
#7
12/09/2004 (11:18 am)
Projectile.cc & projectile.h
Associate Kyle Carter
What sort of simple motion do you want to acheive? There are a lot of resources out there and in the engine; it's possible somebody else already solved your problem.