Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
monkstone committed Apr 15, 2015
1 parent b03571c commit 7cca6ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chp5_physicslibraries/box2d/distance_joint/pair.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Pair
extend Forwardable
def_delegators(:@app, :box2d, :stroke, :line, :stroke_weight)
attr_reader :p1, :p2, :len, :w, :h
attr_reader :p1, :p2, :len
# Chain constructor
def initialize(x, y)
@app = $app
Expand Down Expand Up @@ -40,7 +40,7 @@ def done?
pos2 = box2d.body_coord(p2.body)
# Is it off the screen?
if (0..@app.width).include?(pos1.x) || (0..@app.width).include?(pos2.x)
if (0..@app.height).include?(pos1.y) || (0..@app.width).include?(pos2.y)
if (0..@app.height).include?(pos1.y) || (0..@app.height).include?(pos2.y)
return false
end
end
Expand Down

2 comments on commit 7cca6ca

@monkstone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shiffman Just experimented with trying to destroy the joint (before the the connected particles), it does not seem to play too well. However according to original PBox2D (C++) reference, it is unnecessary as the joint gets destroyed if either point is destroyed.

@shiffman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the note! Should I be making any changes to my Processing versions?

Please sign in to comment.