Vizard 7 » Command Index » Vizard objects » node3d » <node3d>.applyForce
7.7

<node3d>.applyForce

Apply a force to the node

<node3d>.applyForce(  
dir  
duration = 0  
mode = viz.ABS_GLOBAL  
pos = None  
posMode = viz.ABS_GLOBAL  
)  
dir
The force vector. The length of the vector determines the strength of the force.
duration = 0
The length of time that the force is applied to the node. A value of 0 means the force will be applied for one time step.
mode = viz.ABS_GLOBAL
One of the following modes:

Force modes

viz.ABS_GLOBAL

The force vector is specified in global coordinates

viz.ABS_LOCAL

The force vector is specified in the objects local coordinate system.

pos = None
The position from which the force will be applied. If this value is None, then the force will be applied on the center of mass of the object.
posMode = viz.ABS_GLOBAL
One of the following modes:

Position modes

viz.ABS_GLOBAL

The position is specified in global coordinates

viz.ABS_LOCAL

The position is specified in the objects local coordinate system.

Remarks

This command has no effect if physics is not defined on the node.

Return Value

None

Example

box = viz.add('box.wrl')
box.collideBox()
box.applyForce( [0, 0, 10], .1, viz.ABS_GLOBAL, [0, 1, 1] )

See also

<node3d>.applyTorque
<node3d>.getAngularVelocity
<node3d>.getVelocity
<node3d>.setAngularVelocity
<node3d>.setVelocity