From feb2a535fdaf83c25bc74524e9d2a87091f5edc7 Mon Sep 17 00:00:00 2001 From: krogank9 Date: Tue, 28 Mar 2017 16:41:38 -0400 Subject: [PATCH 1/2] Updated demo's motors to use enableMotor and setMotorSpeed functions rather than outdated variables --- demos/car.html | 4 ++-- demos/piston.html | 4 ++-- demos/segway.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demos/car.html b/demos/car.html index 0c5e7795..5efc3213 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..cc84a0eb 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..a13d8c09 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); From 140a651a388554abfe10a814c0f9c2049e4d60be Mon Sep 17 00:00:00 2001 From: krogank9 Date: Tue, 28 Mar 2017 16:44:26 -0400 Subject: [PATCH 2/2] Fixed spacing to match rest of project --- demos/car.html | 2 +- demos/piston.html | 2 +- demos/segway.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demos/car.html b/demos/car.html index 5efc3213..99411416 100644 --- a/demos/car.html +++ b/demos/car.html @@ -79,7 +79,7 @@ // Enable the constraint motor for the back wheel revoluteBack.enableMotor(); - revoluteBack.setMotorSpeed( 10 ); // Rotational speed in radians per second + 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 cc84a0eb..22393933 100644 --- a/demos/piston.html +++ b/demos/piston.html @@ -48,7 +48,7 @@ collideConnected: false }); c.enableMotor(); - c.setMotorSpeed( 5 ); + c.setMotorSpeed(5); world.addConstraint(c); // Create arm diff --git a/demos/segway.html b/demos/segway.html index a13d8c09..6daf2443 100644 --- a/demos/segway.html +++ b/demos/segway.html @@ -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.setMotorSpeed( targetAngularVelocity ); + wheelJoint.setMotorSpeed(targetAngularVelocity); }); app.frame(3,5,16,16);