projects
/
tabakrolletjie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
74cb9cd
)
Fix ordering of rays
author
Neil
<neil@dip.sun.ac.za>
Sat, 10 Sep 2016 21:55:12 +0000
(23:55 +0200)
committer
Neil
<neil@dip.sun.ac.za>
Sat, 10 Sep 2016 21:58:02 +0000
(23:58 +0200)
tabakrolletjie/rays.py
patch
|
blob
|
history
diff --git
a/tabakrolletjie/rays.py
b/tabakrolletjie/rays.py
index 7d880d0aaa5ea417e38cb08fcfe167c5732c42f2..ac51802d2d91315aa2eb5ef07be175b62e1ef89c 100644
(file)
--- a/
tabakrolletjie/rays.py
+++ b/
tabakrolletjie/rays.py
@@
-18,13
+18,13
@@
def screen_rays(pos, bounding_radius):
"""
r = int(bounding_radius)
left, right = int(pos.x) - r, int(pos.x) + r
"""
r = int(bounding_radius)
left, right = int(pos.x) - r, int(pos.x) + r
- bottom, top = int(pos.y)
+ r, int(pos.y) -
r
+ bottom, top = int(pos.y)
- r, int(pos.y) +
r
step = 1
step = 1
- for y in range(
top, bottom
+ 1, step):
+ for y in range(
bottom, top
+ 1, step):
yield pymunk.Vec2d(left, y)
for x in range(left, right + 1, step):
yield pymunk.Vec2d(x, top)
yield pymunk.Vec2d(left, y)
for x in range(left, right + 1, step):
yield pymunk.Vec2d(x, top)
- for y in range(
bottom, top
- 1, -step):
+ for y in range(
top, bottom
- 1, -step):
yield pymunk.Vec2d(right, y)
for x in range(right, left - 1, -step):
yield pymunk.Vec2d(x, bottom)
yield pymunk.Vec2d(right, y)
for x in range(right, left - 1, -step):
yield pymunk.Vec2d(x, bottom)