local physics=require("physics") physics.start() physics.setDrawMode( "hybrid" ) physics.setGravity(0,8) local w=display.contentWidth local h=display.contentHeight local gearL=display.newCircle(w/2-30,h/2,30) gearL:setFillColor(1,0,0,0.7) physics.addBody(gearL,"dynamic",{radius=30,friction=0.5}) local gearR=display.newCircle(w/2+60,h/2,60) gearR:setFillColor(1,0,0,0.7) physics.addBody(gearR,"dynamic",{radius=60,friction=0.5}) local box=display.newRect(w/2+15,h/2,110,30) box:setFillColor(0,1,0,0.3) physics.addBody(box,"static") local pivotJoint1=physics.newJoint("pivot",gearL,box,gearL.x,gearL.y) local pivotJoint2=physics.newJoint("pivot",gearR,box,gearR.x,gearR.y) local gearJoint1=physics.newJoint("gear",gearL,gearR,pivotJoint1,pivotJoint2,3.0) pivotJoint1.isMotorEnabled=true pivotJoint1.motorSpeed=30 pivotJoint1.maxMotorTorque=10000
Now let me tell the problem ,I want ask that if the joint is called a gear Joint than when one gear rotates the should automatically,but that doesn’t happen when I compile the above code can some please explain gear Joint with small sample example because the corona documention is not enough( actually,I didn’t get it!!!)
and also run the above code you will find that gearL is rotating but gearR is not but friction is present between them.