Example #1
0
 def applyRotation(self, velocity):
     self.rotation = self.rotation + velocity
     self.rotation = Math.Vector3(
         mathUtils.reduceToPI(self.rotation[0]),
         mathUtils.reduceToPI(self.rotation[1]),
         mathUtils.reduceToPI(self.rotation[2]),
     )
 def toLimit(self, inAngle):
     inAngle = mathUtils.reduceToPI(inAngle)
     if self.__cycled:
         return inAngle
     if self.__reversed:
         if inAngle >= self.__start and inAngle <= self.__end:
             return inAngle
     elif self.__start <= inAngle <= self.__end:
         return inAngle
     delta1 = self.__start - inAngle
     delta2 = self.__end - inAngle
     return self.__end if math.fabs(delta1) > math.fabs(delta2) else self.__start
Example #3
0
 def toLimit(self, inAngle):
     inAngle = mathUtils.reduceToPI(inAngle)
     if self.__cycled:
         return inAngle
     if self.__reversed:
         if inAngle >= self.__start and inAngle <= self.__end:
             return inAngle
     elif self.__start <= inAngle <= self.__end:
         return inAngle
     delta1 = self.__start - inAngle
     delta2 = self.__end - inAngle
     if math.fabs(delta1) > math.fabs(delta2):
         return self.__end
     return self.__start