summaryrefslogtreecommitdiff
path: root/chroma
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2012-01-24 16:23:47 -0500
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:38 -0700
commit6a5a1bafd0a24ca1b91a972c2f8042d61eaeea7a (patch)
tree8d92de1ef229e5ef4ee3f961a3ff8424f786f25e /chroma
parent70db095406da6a9ffd6d0234298d282b4d6cc12f (diff)
downloadchroma-6a5a1bafd0a24ca1b91a972c2f8042d61eaeea7a.tar.gz
chroma-6a5a1bafd0a24ca1b91a972c2f8042d61eaeea7a.tar.bz2
chroma-6a5a1bafd0a24ca1b91a972c2f8042d61eaeea7a.zip
Use fixed point BVH surface area instead of world coordinates for consistency everywhere.
Diffstat (limited to 'chroma')
-rw-r--r--chroma/bvh/bvh.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/chroma/bvh/bvh.py b/chroma/bvh/bvh.py
index f530b09..f2ef7df 100644
--- a/chroma/bvh/bvh.py
+++ b/chroma/bvh/bvh.py
@@ -229,7 +229,12 @@ class BVHLayerSlice(object):
'''Return number of nodes in this layer'''
return len(self.nodes)
+ def area_fixed(self):
+ '''Return the surface area of all the nodes in this layer in
+ fixed point units.'''
+ node_area(self.nodes)
+
def area(self):
'''Return the surface area of all the nodes in this layer in world
units.'''
- return node_area(self.nodes) * self.world_coords.world_scale**2
+ return self.area_fixed() * self.world_coords.world_scale**2