WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Physics - addThruster (https://forum.worldviz.com/showthread.php?t=2814)

moneim230 07-03-2010 11:41 AM

Physics - addThruster
 
Hello,
i applied a constant force on an object and i wanted to change its value
Code:

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 .reset method.

moneim230 07-11-2010 12:03 AM

Quote:

Originally Posted by Jeff (Post 10319)
You can zero out any forces already added with the .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


All times are GMT -7. The time now is 02:06 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC