Skip to content

Commit 37f784f

Browse files
committed
even fewer loc
1 parent 9161683 commit 37f784f

File tree

1 file changed

+4
-6
lines changed
  • processing_app/library/vecmath/vec2d/library/verlet_chain/lib

1 file changed

+4
-6
lines changed

processing_app/library/vecmath/vec2d/library/verlet_chain/lib/verlet_ball.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ def render
3939

4040
def bounds_collision
4141
if x_bound.exclude? pos.x
42-
pos.x = constrain pos.x, x_bound.lower, x_bound.upper
43-
pos_old.x = pos.x
44-
pos.x = (pos.x <= radius)? pos.x + push.x : pos.x - push.x
42+
pos_old.x = constrain pos.x, x_bound.lower, x_bound.upper
43+
pos.x = (pos.x <= radius)? pos_old.x + push.x : pos_old.x - push.x
4544
end
4645
return unless y_bound.exclude? pos.y
47-
pos.y = constrain pos.y, y_bound.lower, y_bound.upper
48-
pos_old.y = pos.y
49-
pos.y = (pos.y <= radius)? pos.y + push.y : pos.y - push.y
46+
pos_old.y = constrain pos.y, y_bound.lower, y_bound.upper
47+
pos.y = (pos.y <= radius)? pos_old.y + push.y : pos_old.y - push.y
5048
end
5149
end
5250

0 commit comments

Comments
 (0)