本文整理汇总了Python中pandac.PandaModules.SmoothMover.clearPositions方法的典型用法代码示例。如果您正苦于以下问题:Python SmoothMover.clearPositions方法的具体用法?Python SmoothMover.clearPositions怎么用?Python SmoothMover.clearPositions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.SmoothMover
的用法示例。
在下文中一共展示了SmoothMover.clearPositions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DistributedBanquetTable
# 需要导入模块: from pandac.PandaModules import SmoothMover [as 别名]
# 或者: from pandac.PandaModules.SmoothMover import clearPositions [as 别名]
#.........这里部分代码省略.........
def getSlideToPos(toon=toon):
return render.getRelativePoint(toon, Point3(0, -10, 0))
if self.gotHitByBoss:
self.notify.debug("creating zap interval instead")
grabIval = Sequence(
Func(toon.loop, "neutral"),
Func(toon.wrtReparentTo, render),
Parallel(ActorInterval(toon, "slip-backward"), toon.posInterval(0.5, getSlideToPos, fluid=1)),
)
else:
grabIval = Sequence(
Func(toon.loop, "neutral"),
Func(toon.wrtReparentTo, render),
Parallel(
ActorInterval(toon, "jump"),
Sequence(
Wait(0.42999999999999999),
ProjectileInterval(toon, duration=0.90000000000000002, startPos=startPos, endPos=endPos),
),
),
)
return grabIval
def b_clearSmoothing(self):
self.d_clearSmoothing()
self.clearSmoothing()
def d_clearSmoothing(self):
self.sendUpdate("clearSmoothing", [0])
def clearSmoothing(self, bogus=None):
self.pitcherSmoother.clearPositions(1)
def doSmoothTask(self, task):
self.pitcherSmoother.computeAndApplySmoothHpr(self.waterPitcherNode)
return Task.cont
def startSmooth(self):
if not self.smoothStarted:
taskName = self.smoothName
taskMgr.remove(taskName)
self.reloadPosition()
taskMgr.add(self.doSmoothTask, taskName)
self.smoothStarted = 1
def stopSmooth(self):
if self.smoothStarted:
taskName = self.smoothName
taskMgr.remove(taskName)
self.forceToTruePosition()
self.smoothStarted = 0
def _DistributedBanquetTable__enableControlInterface(self):
gui = loader.loadModel("phase_3.5/models/gui/avatar_panel_gui")
self.closeButton = DirectButton(
image=(
gui.find("**/CloseBtn_UP"),
gui.find("**/CloseBtn_DN"),
gui.find("**/CloseBtn_Rllvr"),
gui.find("**/CloseBtn_UP"),
),
relief=None,
scale=2,
text=TTLocalizer.BossbotPitcherLeave,
示例2: DistributedGolfSpot
# 需要导入模块: from pandac.PandaModules import SmoothMover [as 别名]
# 或者: from pandac.PandaModules.SmoothMover import clearPositions [as 别名]
#.........这里部分代码省略.........
self.d_sendGolfSpotPos()
taskMgr.remove(taskName)
taskMgr.doMethodLater(self.__broadcastPeriod, self.__posHprBroadcast, taskName)
def __posHprBroadcast(self, task):
self.d_sendGolfSpotPos()
taskName = self.posHprBroadcastName
taskMgr.doMethodLater(self.__broadcastPeriod, self.__posHprBroadcast, taskName)
return Task.done
def d_sendGolfSpotPos(self):
timestamp = globalClockDelta.getFrameNetworkTime()
self.sendUpdate('setGolfSpotPos', [self.changeSeq, self.root.getH(), timestamp])
def setGolfSpotPos(self, changeSeq, h, timestamp):
self.changeSeq = changeSeq
if self.smoothStarted:
now = globalClock.getFrameTime()
local = globalClockDelta.networkToLocalTime(timestamp, now)
self.golfSpotSmoother.setH(h)
self.golfSpotSmoother.setTimestamp(local)
self.golfSpotSmoother.markPosition()
else:
self.root.setH(h)
def b_clearSmoothing(self):
self.d_clearSmoothing()
self.clearSmoothing()
def d_clearSmoothing(self):
self.sendUpdate('clearSmoothing', [0])
def clearSmoothing(self, bogus = None):
self.golfSpotSmoother.clearPositions(1)
def doSmoothTask(self, task):
self.golfSpotSmoother.computeAndApplySmoothHpr(self.root)
return Task.cont
def startSmooth(self):
if not self.smoothStarted:
taskName = self.smoothName
taskMgr.remove(taskName)
self.reloadPosition()
taskMgr.add(self.doSmoothTask, taskName)
self.smoothStarted = 1
def stopSmooth(self):
if self.smoothStarted:
taskName = self.smoothName
taskMgr.remove(taskName)
self.forceToTruePosition()
self.smoothStarted = 0
def makeToonReleaseInterval(self, toon):
def getSlideToPos(toon = toon):
return render.getRelativePoint(toon, Point3(0, -5, 0))
if self.gotHitByBoss:
grabIval = Sequence(Func(self.detachClub), name='makeToonReleaseInterval-gotHitByBoss')
if not toon.isEmpty():
toonIval = Sequence(Func(toon.wrtReparentTo, render), Parallel(ActorInterval(toon, 'slip-backward'), toon.posInterval(0.5, getSlideToPos, fluid=1)), name='makeToonReleaseInterval-toonIval')
grabIval.append(toonIval)
else:
grabIval = Sequence(Func(self.detachClub))