Game Development Community

Impulse Force applied to rotation...?

by Matt Van Gorkom · in Torque Game Builder · 04/21/2005 (9:46 am) · 8 replies

I haven't seen a command for it, but is there a way to apply an impulse force to rotation?

#1
04/21/2005 (9:56 am)
Not at the moment. I mentioned this a little while back when trying to figure out if my lowly c++ skills would be enough to try and add torque as a property. If memory serves, I believe Melv said that torque would be added at some point in the future.

For the time being, I simply have a schedule increment the angular velocity to give the impression of torque.
#2
04/21/2005 (10:04 am)
Thanks, yeah I did a work-around and then realized it'd be nice to have a function for such a thing.
#3
04/21/2005 (12:04 pm)
Technically, if you're wanting to apply forces "to rotation", what you really want is a full rigid-rotor physics system. That is, you apply forces to a location on an object. The physics system will case a rotational and positional change based on that. This is how real physics works to determine where an object goes and what it's orientation is.

If you want to spin something around, without moving it, you have to apply (at least) two forces that counteract each other's positional adjustment to create a specific rotational one.
#4
04/22/2005 (6:09 am)
There will be an angular-force call.

Within the engine, there is already a call to do what Smaug calls a rigid-rotor thingy. The C++ call is "fxPhysics2D::AddTorqueForce". This essentially adds a force to a particular point on the object and can cause linear and/or angular velocity changes. Again, this assumes that the center of the object is the pivot, something which will also be changing.

This, and other stuff, hasn't been exposed to the script-engine yet. The physics will get more love but we're dealing with more important features at the moment as well as bug fixes.

We'll get there. :)

- Melv.
#5
04/22/2005 (6:40 am)
Hmm. I must've been sleeping when I grepped the source for "torque" those weeks ago, since I didn't see AddTorqueForce. o_O That'll teach me to not sleep. :-p
#6
04/22/2005 (10:33 am)
It was renamed, as was other stuff. I think it was called "addPointForce()" or something like that.

- Melv.
#7
04/22/2005 (11:28 am)
Cool :)
#8
04/22/2005 (11:45 am)
Man, I think I saw that one, too, when I was originally looking for an unexposed torque property. Just didn't realize what it was. :-p