Skip to content

Commit

Permalink
Example renderer: refer to this.world instead of global world
Browse files Browse the repository at this point in the history
  • Loading branch information
jes authored and shakiba committed May 2, 2024
1 parent 09cf743 commit fe82918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/pages/rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Renderer {
this.world.step(1 / 60);

// Iterate over bodies
for (let body = world.getBodyList(); body; body = body.getNext()) {
for (let body = this.world.getBodyList(); body; body = body.getNext()) {
this.renderBody(body);
// ... and fixtures
for (let fixture = body.getFixtureList(); fixture; fixture = fixture.getNext()) {
Expand All @@ -64,7 +64,7 @@ class Renderer {
}

// Iterate over joints
for (let joint = world.getJointList(); joint; joint = joint.getNext()) {
for (let joint = this.world.getJointList(); joint; joint = joint.getNext()) {
this.renderJoint(joint);
}

Expand Down

0 comments on commit fe82918

Please sign in to comment.