Game Development Community

Is it possible to set multiple setConstantForce()

by Jesse Hall · in Torque Game Builder · 07/11/2005 (10:44 am) · 4 replies

Does setConstantForcePolar() keep adding forces or change the values for just the one force?

Is it possible to set multiple forces?

#1
02/27/2006 (6:21 pm)
I don't think so. Do you know how many vectors are going to apply force on the object? If so, you can probably just calculate the actual force vector given the multiple directional vectors you have. I know there's an equation for that but I'm at a loss for it at the moment.

--john
#2
02/28/2006 (12:46 am)
I don't think you can either.

What I do is track all the forces as vectors and each time one changes recalculate the overall vector as a sum of the individual vectors and apply that using the setConstantForce functions.
#3
03/03/2006 (12:01 am)
Jesse,

You can simply add the forces together. If you want to "add" a force, simply retrieve the existing one, add the new one to it and then set the new force.

This is just basic Vector Addition.

Hope this helps,

- Melv.
#4
03/03/2006 (3:04 pm)
Thanks Melv!