projects
/
tabakrolletjie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ee3a75
)
corrected power usage calculation to exclude area within inner radius
author
adrianna
<adrianna.pinska@gmail.com>
Fri, 16 Sep 2016 15:34:14 +0000
(17:34 +0200)
committer
adrianna
<adrianna.pinska@gmail.com>
Fri, 16 Sep 2016 15:34:14 +0000
(17:34 +0200)
tabakrolletjie/lights.py
patch
|
blob
|
history
diff --git
a/tabakrolletjie/lights.py
b/tabakrolletjie/lights.py
index ac6f08e38c279ec39d2847e2b181ca43b5a5eb6a..06f84badbb88c90034e2cfda6f129547093ffebe 100644
(file)
--- a/
tabakrolletjie/lights.py
+++ b/
tabakrolletjie/lights.py
@@
-313,8
+313,9
@@
class BaseLight(object):
def power_usage(self):
if not self.on:
return 0.0
- area = math.pi * (self.ray_manager.max_radius ** 2) # radius
- area = area * (self.ray_manager.spread / (2 * math.pi)) # spread
+ rm = self.ray_manager
+ area = math.pi * (rm.max_radius ** 2 - rm.min_radius ** 2) # radius
+ area = area * (rm.spread / (2 * math.pi)) # spread
return 5 * area * self.intensity / 6400 # 80x80 unit area
def base_damage(self):