Permalink
Browse files

Fixed: TypeError in frustum.visible1

Was calling builtin sum() and any() when numpy's routines are needed.
  • Loading branch information...
1 parent 2a1a6aa commit aa6a9524e6d043b5991ef13f4a6751bfe04a22cf @codewarrior0 codewarrior0 committed Nov 26, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 frustum.py
View
@@ -85,14 +85,14 @@ def visible(self, points, radius):
frustcullaccel C extension module)
"""
- distances = sum(self.planes[numpy.newaxis, :, :] * points[:, numpy.newaxis, :], -1)
- return ~any(distances < -radius, -1)
+ distances = numpy.sum(self.planes[numpy.newaxis, :, :] * points[:, numpy.newaxis, :], -1)
+ return ~numpy.any(distances < -radius, -1)
def visible1(self, point, radius):
#return self.visible(array(point[numpy.newaxis, :]), radius)
- distance = sum(self.planes * point, -1)
- vis = ~any(distance < -radius)
+ distance = numpy.sum(self.planes * point, -1)
+ vis = ~numpy.any(distance < -radius, -1)
#assert vis == self.visible(array(point)[numpy.newaxis, :], radius)
return vis

0 comments on commit aa6a952

Please sign in to comment.