本文整理匯總了Python中pandac.PandaModules.SmoothMover.computeAndApplySmoothHpr方法的典型用法代碼示例。如果您正苦於以下問題:Python SmoothMover.computeAndApplySmoothHpr方法的具體用法?Python SmoothMover.computeAndApplySmoothHpr怎麽用?Python SmoothMover.computeAndApplySmoothHpr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pandac.PandaModules.SmoothMover
的用法示例。
在下文中一共展示了SmoothMover.computeAndApplySmoothHpr方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DistributedBanquetTable
# 需要導入模塊: from pandac.PandaModules import SmoothMover [as 別名]
# 或者: from pandac.PandaModules.SmoothMover import computeAndApplySmoothHpr [as 別名]
#.........這裏部分代碼省略.........
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,
text_scale=0.040000000000000001,
text_pos=(0, -0.070000000000000007),
text_fg=VBase4(1, 1, 1, 1),
示例2: DistributedGolfSpot
# 需要導入模塊: from pandac.PandaModules import SmoothMover [as 別名]
# 或者: from pandac.PandaModules.SmoothMover import computeAndApplySmoothHpr [as 別名]
#.........這裏部分代碼省略.........
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))
if not toon.isEmpty():
toonIval = Sequence(Parallel(ActorInterval(toon, 'walk', duration=1.0, playRate=-1.0), LerpPosInterval(toon, duration=1.0, pos=Point3(-10, 0, 0))), Func(toon.wrtReparentTo, render))
grabIval.append(toonIval)