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 committed May 1, 2024
1 parent e8e3ff9 commit 2b8ba59
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 @@ -51,7 +51,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 @@ -60,7 +60,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 2b8ba59

Please sign in to comment.