You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I do not know if the following behaviour is expected when I am chaining hinges:
You can see how the shaft are bent, It do not happend with only one constraint. The following code is created from Hige example:
demo.addScene('Hinge',()=>{constworld=demo.getWorld()world.gravity.set(0,-20,5)constmass=1constsize=5constdistance=size*0.1constshape=newCANNON.Box(newCANNON.Vec3(size*0.5,size*0.5,size*0.1))consthingedBody=newCANNON.Body({ mass })hingedBody.addShape(shape)world.addBody(hingedBody)demo.addVisual(hingedBody)consthingedBody2=newCANNON.Body({ mass })hingedBody2.addShape(shape)world.addBody(hingedBody2)demo.addVisual(hingedBody2)consthingedBody3=newCANNON.Body({ mass })hingedBody3.addShape(shape)world.addBody(hingedBody3)demo.addVisual(hingedBody3)conststaticBody=newCANNON.Body({mass: 0})staticBody.addShape(shape)staticBody.position.y=size+distance*2world.addBody(staticBody)demo.addVisual(staticBody)// Hinge itconstconstraint=newCANNON.HingeConstraint(staticBody,hingedBody,{pivotA: newCANNON.Vec3(0,-size*0.5-distance,0),axisA: newCANNON.Vec3(-1,0,0),pivotB: newCANNON.Vec3(10,size*0.5+distance,0),axisB: newCANNON.Vec3(-1,0,0),})world.addConstraint(constraint)// Hinge itconstconstraint2=newCANNON.HingeConstraint(hingedBody,hingedBody2,{pivotA: newCANNON.Vec3(0,-size*0.5-distance,0),axisA: newCANNON.Vec3(-1,0,0),pivotB: newCANNON.Vec3(10,size*0.5+distance,0),axisB: newCANNON.Vec3(-1,0,0),})world.addConstraint(constraint2)// Hinge itconstconstraint3=newCANNON.HingeConstraint(hingedBody2,hingedBody3,{pivotA: newCANNON.Vec3(0,-size*0.5-distance,0),axisA: newCANNON.Vec3(-1,0,0),pivotB: newCANNON.Vec3(10,size*0.5+distance,0),axisB: newCANNON.Vec3(-1,0,0),})world.addConstraint(constraint3)})
The text was updated successfully, but these errors were encountered:
Hi, I do not know if the following behaviour is expected when I am chaining hinges:
You can see how the shaft are bent, It do not happend with only one constraint. The following code is created from Hige example:
The text was updated successfully, but these errors were encountered: