PDA

View Full Version : Physics - addThruster


moneim230
07-03-2010, 11:41 AM
Hello,
i applied a constant force on an object and i wanted to change its value

F=[0,0,0]
def UpdateThruster():
force=ball.addThruster(mode=viz.ABS_GLOBAL,force=F )
vizact.ontimer(0,UpdateThruster)

def onKeyDown(key):
if key == ' ':
F[2]=1

viz.callback(viz.KEYDOWN_EVENT,onKeyDown)


i found that the force is accumulated each time the function UpdateThruster happens
so, when i press space once, the ball starts accelerating very fast
please i need to apply a force and change its value anytime i want...how can i do this ??

Jeff
07-05-2010, 02:58 PM
You can zero out any forces already added with the <node3D>.reset method.

moneim230
07-11-2010, 12:03 AM
You can zero out any forces already added with the <node3D>.reset method.

thanks Jeff
i have a question here
is there a better way than this (calling a function with 0 timer) to update the value of the force
actually i am working on a vehicle model and i need to get the inertia force applied when i leave the gas pedal