Vizard 8 » Command Index » Vizard objects » node3d » <node3d>.setVelocity
8.0

<node3d>.setVelocity

Sets the velocity of the node

<node3d>.setVelocity(  
[ vx, vy, vz ]  
mode = viz.ABS_GLOBAL  
)  
[ vx, vy, vz ]
The velocity vector
mode = viz.ABS_GLOBAL
If viz.ABS_GLOBAL, the velocity will be specified in global coordinates. Otherwise the velocity will be specified in the objects local coordinate frame.

Remarks

Sets the current velocity, which may change due to forces acting on the node.

Return Value

None

Example

viz.phys.enable()
ball = viz.addChild('beachball.osgb')
ball.collideSphere()
ball.setVelocity([0, 10, 0])

See also

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