diff --git a/demos/car.html b/demos/car.html index 0c5e7795..99411416 100644 --- a/demos/car.html +++ b/demos/car.html @@ -78,8 +78,8 @@ world.addConstraint(revoluteFront); // Enable the constraint motor for the back wheel - revoluteBack.motorEnabled = true; - revoluteBack.motorSpeed = 10; // Rotational speed in radians per second + revoluteBack.enableMotor(); + revoluteBack.setMotorSpeed(10); // Rotational speed in radians per second this.frame(0, 0, 8, 6); }); diff --git a/demos/piston.html b/demos/piston.html index 563eec16..22393933 100644 --- a/demos/piston.html +++ b/demos/piston.html @@ -47,8 +47,8 @@ worldPivot: [0, 0], collideConnected: false }); - c.motorEnabled = true; - c.motorSpeed = 5; + c.enableMotor(); + c.setMotorSpeed(5); world.addConstraint(c); // Create arm diff --git a/demos/segway.html b/demos/segway.html index c57008c8..6daf2443 100644 --- a/demos/segway.html +++ b/demos/segway.html @@ -65,7 +65,7 @@ collideConnected: false }); world.addConstraint(wheelJoint); - wheelJoint.motorEnabled = true; + wheelJoint.enableMotor(); var m = 40; wheelJoint.motorEquation.maxForce = m; wheelJoint.motorEquation.minForce = -m; @@ -106,7 +106,7 @@ // this is the only output var targetAngularVelocity = -targetSpeed / (2 * Math.PI * wheelBody.shapes[0].radius); // wheel circumference = 2*pi*r - wheelJoint.motorSpeed = targetAngularVelocity; + wheelJoint.setMotorSpeed(targetAngularVelocity); }); app.frame(3,5,16,16);