PDA

View Full Version : Physics engine problem


zytcll
01-11-2017, 11:19 PM
Hi,

I have a long bar with nodes from [node00] to [node10] side by side, and its center is as same as [node05].

Now I want to let parts of nodes visible and fall down, so I set collideBox to only these nodes, and set other nodes with collideNone.

When center node [node05] is included in collision nodes, it works normally. However, when center node is node included, it starts rotating after landing.



bar.setPosition([0, 4, 0] )

for i in range(11):
nodeName = "bar"
if k < 10:
nodeName += str(0)
nodeName += str(k)

if (k > 6) and (k < 9):
bar.visible(viz.ON, node = nodeName )
bar.collideBox(node = nodeName)
else:
bar.visible(viz.OFF, node = nodeName)


I think I should reset the center of the bar, but it still works badly after I use setCenter(pos), so is there any way to solve this problem?