Game Development Community

Smooth rotation of objects?

by Dave Calabrese · in Torque Game Engine · 01/26/2005 (8:48 am) · 4 replies

Anyone ever tried to make any staticshape have a smooth rotation like the items do?

I played around a little with trying to copy/paste the item rotation code into the StaticShape code, but kept getting all sorts of weird errors. The end-result I'm looking for is the ability to rotate an object, smoothly, in either direction on its Z axis.

So, anyone ever tried anything like this, successfully?

#1
01/27/2005 (5:34 pm)
You'll have to do this with some C++ changes, particularly to get interpolation and prediction working properly.
#2
01/28/2005 (3:25 am)
Hi,

I did something similar a few months ago with the aiplayer code. See if this helps you:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5268

It worked for players...
#3
01/28/2005 (12:46 pm)
I ended up taking a peak into the Advanced Camera resource to get some ideas (as I'm rather new to engine coding). Once I get this completed I'll see about posting a resource about "custom-controlled smooth rotations of StaticShapes".
#4
02/07/2005 (5:24 am)
Dave, try this function:

function InsertTestShape()
// ----------------------------------------------------
// Instantiates the test shape, then inserts it
// into the game world roughly in front of the
// the player's default spawn location.
// ----------------------------------------------------
{
// An example function which creates a new TestShape object
%shape = new Item() {

datablock = TestShape;
rotate = true;
};
MissionCleanup.add(%shape);

// Player setup
%shape.setTransform("5 -3 0 0 0 1 0");
echo("Inserting Shape " @ %shape);
return %shape;
}