本文整理汇总了Python中pandac.PandaModules.SmoothMover.setPhonyTimestamp方法的典型用法代码示例。如果您正苦于以下问题:Python SmoothMover.setPhonyTimestamp方法的具体用法?Python SmoothMover.setPhonyTimestamp怎么用?Python SmoothMover.setPhonyTimestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.SmoothMover
的用法示例。
在下文中一共展示了SmoothMover.setPhonyTimestamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DistributedBanquetTable
# 需要导入模块: from pandac.PandaModules import SmoothMover [as 别名]
# 或者: from pandac.PandaModules.SmoothMover import setPhonyTimestamp [as 别名]
#.........这里部分代码省略.........
self.changeSeq = changeSeq
if self.smoothStarted:
now = globalClock.getFrameTime()
local = globalClockDelta.networkToLocalTime(timestamp, now)
self.pitcherSmoother.setH(h)
self.pitcherSmoother.setTimestamp(local)
self.pitcherSmoother.markPosition()
else:
self.waterPitcherNode.setH(h)
def _DistributedBanquetTable__watchControls(self, task):
if self.arrowHorz:
self._DistributedBanquetTable__movePitcher(self.arrowHorz)
else:
self._DistributedBanquetTable__setMoveSound(None)
return Task.cont
def _DistributedBanquetTable__movePitcher(self, xd):
dt = globalClock.getDt()
h = self.waterPitcherNode.getH() - xd * self.rotateSpeed * dt
h %= 360
self.notify.debug(
"rotSpeed=%.2f curH=%.2f xd =%.2f, dt = %.2f, h=%.2f"
% (self.rotateSpeed, self.waterPitcherNode.getH(), xd, dt, h)
)
limitH = h
self.waterPitcherNode.setH(limitH)
if xd:
self._DistributedBanquetTable__setMoveSound(self.pitcherMoveSfx)
def reloadPosition(self):
self.pitcherSmoother.clearPositions(0)
self.pitcherSmoother.setHpr(self.waterPitcherNode.getHpr())
self.pitcherSmoother.setPhonyTimestamp()
def forceToTruePosition(self):
if self.pitcherSmoother.getLatestPosition():
self.pitcherSmoother.applySmoothHpr(self.waterPitcherNode)
self.pitcherSmoother.clearPositions(1)
def getSprayTrack(
self, color, origin, target, dScaleUp, dHold, dScaleDown, horizScale=1.0, vertScale=1.0, parent=render
):
track = Sequence()
SPRAY_LEN = 1.5
sprayProp = MovieUtil.globalPropPool.getProp("spray")
sprayScale = hidden.attachNewNode("spray-parent")
sprayRot = hidden.attachNewNode("spray-rotate")
spray = sprayRot
spray.setColor(color)
if color[3] < 1.0:
spray.setTransparency(1)
def showSpray(sprayScale, sprayRot, sprayProp, origin, target, parent):
if callable(origin):
origin = origin()
if callable(target):
target = target()
sprayRot.reparentTo(parent)
sprayRot.clearMat()
sprayScale.reparentTo(sprayRot)
sprayScale.clearMat()
sprayProp.reparentTo(sprayScale)