Example #1
0
 def find_selected_actor(self, near, far):
     """ Finds the first actor """
     for a in self.ag.actors:
         # aabb intersection
         if not a.aabb is None:
             if test_segment_aabb(near, far, a.aabb.coord[0], a.aabb.coord[1]):
                 print "found aabb"
                 return a
             else:
                 print "no aabb"
                 return None
Example #2
0
File: world.py Project: arokem/Fos
 def find_selected_actor(self, near, far):
     """ Finds the first actor """
     for a in self.ag.actors:
         # aabb intersection
         if not a.aabb is None:
             ab1, ab2 = a.get_aabb_coords()
             if test_segment_aabb(near, far, ab1, ab2):
                 print "found aabb"
                 return a
             else:
                 print "no aabb"
                 return None
Example #3
0
 def propagate_pickray(self, near, far):
     # propagate the pickray to all the actors
     # XXX: implement intersection with the bounding boxes first
     
     for a in self.ag.actors:
         # aabb intersection
         if not a.aabb is None:
             if test_segment_aabb(near, far, a.aabb.coord[0], a.aabb.coord[1]):
                 print "found aabb"
                 try:
                     a.process_pickray(near,far)
                 except:
                     pass
             else:
                 print "no aabb"
Example #4
0
 def propagate_pickray(self, near, far):
     # propagate the pickray to all the actors
     # XXX: implement intersection with the bounding boxes first
     
     for a in self.ag.actors:
         # aabb intersection
         if not a.aabb is None:
             ab1, ab2 = a.get_aabb_coords()
             #print 'pick', ab1, ab2
             if test_segment_aabb(near, far, ab1, ab2):
                 #print "found aabb"
                 try:
                     a.process_pickray(near,far)
                 except Exception as e:
                     print e
             else:
                 #print "no aabb"
                 pass