Beispiel #1
0
 def keyboard(self, key, x, y):
     ''' 
     Since FlythroughCamera is a child of GLUTWindow, this function will get
     called whenever there's a keyboard event.
     '''
     if key == 'p' or key == 'P':
         self.add_keyframe()
     elif key == 'g' or key == 'G':
         if self.NSeg < 1:
             self.bAnimate = False
         else:
             self.bAnimate = not self.bAnimate
         self.reset_position()
     elif key == 'c' or key == 'C':
         self.init_flythrough()
     # if View class happens to implement any keyboard functionality then
     # call it as well.
     if(hasattr(View, 'keyboard')):
         View.keyboard(key, x, y)