Exemplo n.º 1
0
 def GetAxis( self, collEntry ):
     axis = Base.GetAxis( self, collEntry )
     
     # Return None if the axis is None
     if axis is None:
         return None
     
     if axis.vector != CAMERA_VECTOR:
         
         # Return the axis from the specified normal within a tolerance of 
         # degrees
         normal = collEntry.getSurfaceNormal( self )
         normal.normalize()
         for axis in self.axes:
             if math.fabs( normal.angleDeg( axis.vector ) - 90 ) < ( 2.5 / self.size ):
                 return axis
     else:
         
         # Get the collision point on the poly, return the axis if the
         # mouse is within tolerance of the circle
         point = collEntry.getSurfacePoint( collEntry.getIntoNodePath() )
         length = Vec3( point / 1.25 ).length()
         if length > 0.9 and length < 1:
             return axis