Thread: Physics Problem
View Single Post
  #4  
Old 03-20-2009, 01:07 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Sound like you want to call forklift.disable(viz.DYNAMICS). With this function the forklift collide shapes will push/lift the boxes, but no dynamic forces will move the forklift.

Also, from your code I see that you are creating collide shapes on "bars" that are not children of viz.WORLD. This is a problem. The physics engine assumes collide shapes live on nodes that are children of viz.WORLD. If the collide shapes are not associated with direct children of viz.WORLD, then the collide shapes will not be properly positioned on the nodes if the nodes are not at position (0,0,0).

To fix, set up your forklift geometry, making sub-nodes children of some common parent node, we'll call ''forklift''. Then call forklift.collideMesh(), assuming "forklift" is a child of viz.WORLD. With the collideMesh command you can also forgo the disable(viz.DYNAMICS) command because the physics engine does not support dynamic forces on collideMesh shapes so they will not be applied anyway.
__________________
Paul Elliott
WorldViz LLC
Reply With Quote