oldschool-toontown/toontown/minigame/Ring.py
Little Cat 1801d2b9fb
all: replace pandac.PandaModules imports.
UD/AI + Client boots up.
2022-12-16 20:40:57 -04:00

27 lines
844 B
Python

from panda3d.core import *
from toontown.toonbase.ToonBaseGlobal import *
from panda3d.core import NodePath
from . import RingTrack
class Ring(NodePath):
def __init__(self, moveTrack, tOffset, posScale = 1.0):
NodePath.__init__(self)
self.assign(hidden.attachNewNode(base.localAvatar.uniqueName('ring')))
self.setMoveTrack(moveTrack)
self.setTOffset(tOffset)
self.setPosScale(posScale)
self.setT(0.0)
def setMoveTrack(self, moveTrack):
self.__moveTrack = moveTrack
def setTOffset(self, tOffset):
self.__tOffset = float(tOffset)
def setPosScale(self, posScale):
self.__posScale = posScale
def setT(self, t):
pos = self.__moveTrack.eval((t + self.__tOffset) % 1.0)
self.setPos(pos[0] * self.__posScale, 0, pos[1] * self.__posScale)