Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo's motors don't work because of outdated variables #292

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demos/car.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
4 changes: 2 additions & 2 deletions demos/piston.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions demos/segway.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down