本文整理汇总了Python中direct.distributed.DistributedSmoothNode类的典型用法代码示例。如果您正苦于以下问题:Python DistributedSmoothNode类的具体用法?Python DistributedSmoothNode怎么用?Python DistributedSmoothNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DistributedSmoothNode类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: announceGenerate
def announceGenerate(self):
self.notify.debug('announceGenerate: %s' % self.doId)
DistributedObject.DistributedObject.announceGenerate(self)
musicFile = self.BGM_BaseDir + RaceGlobals.TrackDict[self.trackId][7]
self.raceMusic = base.loadMusic(musicFile)
base.playMusic(self.raceMusic, looping=1, volume=0.8)
base.camera.reparentTo(render)
if self.trackId in (RaceGlobals.RT_Urban_1,
RaceGlobals.RT_Urban_1_rev,
RaceGlobals.RT_Urban_2,
RaceGlobals.RT_Urban_2_rev):
self.isUrbanTrack = True
self.oldFarPlane = base.camLens.getFar()
base.camLens.setFar(12000)
localAvatar.startPosHprBroadcast()
localAvatar.d_broadcastPositionNow()
DistributedSmoothNode.activateSmoothing(1, 1)
self.reversed = self.trackId / 2.0 > int(self.trackId / 2.0)
for i in xrange(3):
base.loader.tick()
self.sky = loader.loadModel('phase_3.5/models/props/TT_sky')
self.sky.setPos(0, 0, 0)
self.sky.setScale(20.0)
self.sky.setFogOff()
if self.trackId in (RaceGlobals.RT_Urban_1,
RaceGlobals.RT_Urban_1_rev,
RaceGlobals.RT_Urban_2,
RaceGlobals.RT_Urban_2_rev):
self.loadFog()
self.setupGeom()
self.startSky()
for i in xrange(5):
base.loader.tick()
示例2: takeLocalAvatarOutOfActivity
def takeLocalAvatarOutOfActivity(self):
self.notify.debug('localToon has left the circle')
camera.reparentTo(base.localAvatar)
base.localAvatar.startUpdateSmartCamera()
base.localAvatar.enableSmartCameraViews()
base.localAvatar.setCameraPositionByIndex(base.localAvatar.cameraIndex)
DistributedSmoothNode.activateSmoothing(1, 0)
示例3: offstage
def offstage(self):
self.notify.debug('offstage')
DistributedMinigame.offstage(self)
self.introMovie.finish()
self.boatTilt.finish()
self.mapModel.hide()
DistributedSmoothNode.activateSmoothing(1, 0)
for avId in self.toonSDs.keys():
self.toonSDs[avId].exit()
base.camLens.setFar(ToontownGlobals.DefaultCameraFar)
base.camLens.setMinFov(ToontownGlobals.DefaultCameraFov/(4./3.))
base.setBackgroundColor(ToontownGlobals.DefaultBackgroundColor)
self.arrowKeys.destroy()
del self.arrowKeys
self.environNode.removeNode()
del self.environNode
if None != self.sndAmbience:
self.sndAmbience.stop()
for avId in self.avIdList:
av = self.getAvatar(avId)
if av:
av.dropShadow.show()
av.resetLOD()
av.setAnimState('neutral', 1.0)
self.dead = 1
self.__killCrabTask()
for spawner in self.spawners:
spawner.destroy()
del spawner
del self.spawners
for crab in self.crabs:
crab.moveLerp.finish()
crab.moveLerp = None
crab.removeNode()
del crab
if hasattr(self, 'treasures') and self.treasures:
for i in range(self.NUMTREASURES):
self.treasures[i].destroy()
del self.treasures
if hasattr(self, 'cSphereNodePath1'):
self.cSphereNodePath1.removeNode()
del self.cSphereNodePath1
if hasattr(self, 'cSphereNodePath1'):
self.cSphereNodePath2.removeNode()
del self.cSphereNodePath2
if hasattr(self, 'remoteToonCollNPs'):
for np in self.remoteToonCollNPs.values():
np.removeNode()
del self.remoteToonCollNPs
self.pusher = None
self.cTrav = None
self.cTrav2 = None
base.localAvatar.collisionsOn()
return
示例4: disable
def disable(self):
self.notify.debug('disable %s' % self.doId)
if self.musicTrack:
self.musicTrack.finish()
self.raceMusic.stop()
self.stopSky()
if self.sky is not None:
self.sky.removeNode()
if self.dummyNode:
self.dummyNode.removeNode()
self.dummyNode = None
for taskName in self.miscTaskNames:
taskMgr.remove(taskName)
taskMgr.remove('raceWatcher')
self.ignoreAll()
DistributedSmoothNode.activateSmoothing(1, 0)
if self.isUrbanTrack:
self.unloadUrbanTrack()
if self.fog:
render.setFogOff()
del self.fog
self.fog = None
if self.geom is not None:
self.geom.hide()
base.camLens.setFar(self.oldFarPlane)
DistributedObject.DistributedObject.disable(self)
return
示例5: onstage
def onstage(self):
self.notify.debug('onstage')
DistributedMinigame.onstage(self)
self.ground.reparentTo(render)
self.scorePanels = []
camera.reparentTo(render)
camera.setPosHpr(*self.CameraPosHpr)
lt = base.localAvatar
lt.reparentTo(render)
self._DistributedCatchGame__placeToon(self.localAvId)
lt.setSpeed(0, 0)
toonSD = self.toonSDs[self.localAvId]
toonSD.enter()
toonSD.fsm.request('normal')
self.orthoWalk.stop()
radius = 0.69999999999999996
handler = CollisionHandlerEvent()
handler.setInPattern('ltCatch%in')
self.ltLegsCollNode = CollisionNode('catchLegsCollNode')
self.ltLegsCollNode.setCollideMask(ToontownGlobals.CatchGameBitmask)
self.ltHeadCollNode = CollisionNode('catchHeadCollNode')
self.ltHeadCollNode.setCollideMask(ToontownGlobals.CatchGameBitmask)
self.ltLHandCollNode = CollisionNode('catchLHandCollNode')
self.ltLHandCollNode.setCollideMask(ToontownGlobals.CatchGameBitmask)
self.ltRHandCollNode = CollisionNode('catchRHandCollNode')
self.ltRHandCollNode.setCollideMask(ToontownGlobals.CatchGameBitmask)
legsCollNodepath = lt.attachNewNode(self.ltLegsCollNode)
legsCollNodepath.hide()
head = base.localAvatar.getHeadParts().getPath(2)
headCollNodepath = head.attachNewNode(self.ltHeadCollNode)
headCollNodepath.hide()
lHand = base.localAvatar.getLeftHands()[0]
lHandCollNodepath = lHand.attachNewNode(self.ltLHandCollNode)
lHandCollNodepath.hide()
rHand = base.localAvatar.getRightHands()[0]
rHandCollNodepath = rHand.attachNewNode(self.ltRHandCollNode)
rHandCollNodepath.hide()
lt.cTrav.addCollider(legsCollNodepath, handler)
lt.cTrav.addCollider(headCollNodepath, handler)
lt.cTrav.addCollider(lHandCollNodepath, handler)
lt.cTrav.addCollider(lHandCollNodepath, handler)
if self.ShowToonSpheres:
legsCollNodepath.show()
headCollNodepath.show()
lHandCollNodepath.show()
rHandCollNodepath.show()
self.ltLegsCollNode.addSolid(CollisionSphere(0, 0, radius, radius))
self.ltHeadCollNode.addSolid(CollisionSphere(0, 0, 0, radius))
self.ltLHandCollNode.addSolid(CollisionSphere(0, 0, 0, 2 * radius / 3.0))
self.ltRHandCollNode.addSolid(CollisionSphere(0, 0, 0, 2 * radius / 3.0))
self.toonCollNodes = [
legsCollNodepath,
headCollNodepath,
lHandCollNodepath,
rHandCollNodepath]
if self.PredictiveSmoothing:
DistributedSmoothNode.activateSmoothing(1, 1)
self.introMovie.start()
示例6: offstage
def offstage(self):
self.notify.debug('offstage')
DistributedSmoothNode.activateSmoothing(1, 0)
NametagGlobals.setMasterArrowsOn(0)
DistributedMinigame.offstage(self)
self.sky.reparentTo(hidden)
self.ground.reparentTo(hidden)
base.camLens.setFar(ToontownGlobals.DefaultCameraFar)
self.itText.hide()
示例7: onstage
def onstage(self):
self.notify.debug('onstage')
DistributedMinigame.onstage(self)
self.ground.reparentTo(render)
self.sky.reparentTo(render)
myPos = self.avIdList.index(self.localAvId)
base.localAvatar.setPosHpr(*self.initialPositions[myPos])
base.localAvatar.reparentTo(render)
base.localAvatar.loop('neutral')
camera.reparentTo(render)
camera.setPosHpr(0, -24, 16, 0, -30, 0)
base.camLens.setFar(450.0)
base.transitions.irisIn(0.40000000000000002)
NametagGlobals.setMasterArrowsOn(1)
DistributedSmoothNode.activateSmoothing(1, 1)
self.IT = None
示例8: enterPrepareShard
def enterPrepareShard(self, shardId):
self.cr.distributedDistrict = self.cr.getDo(shardId)
DistributedSmoothNode.globalActivateSmoothing(1, 0)
h = HashVal()
hashPrcVariables(h)
pyc = HashVal()
if not __dev__:
self.cr.hashFiles(pyc)
self.cr.timeManager.d_setSignature(self.cr.userSignature, h.asBin(), pyc.asBin())
if self.cr.timeManager.synchronize('startup'):
self.acceptOnce('gotTimeSync', self.request, extraArgs = [
'ShardReady',
shardId])
else:
self.demand('ShardReady', shardId)
示例9: onstage
def onstage(self):
self.notify.debug("onstage")
DistributedMinigame.onstage(self)
self.ground.reparentTo(render)
self.sky.reparentTo(render)
myPos = self.avIdList.index(self.localAvId)
base.localAvatar.setPosHpr(*self.initialPositions[myPos])
base.localAvatar.reparentTo(render)
base.localAvatar.loop("neutral")
camera.reparentTo(render)
camera.setPosHpr(0, 45, 44, 0, -50, 0)
base.camLens.setFar(450.0)
base.transitions.irisIn(0.4)
NametagGlobals.setWant2dNametags(True)
DistributedSmoothNode.activateSmoothing(1, 1)
self.IT = None
return
示例10: offstage
def offstage(self):
self.notify.debug('offstage')
DistributedSmoothNode.activateSmoothing(1, 0)
self.introMovie.finish()
for avId in self.toonSDs.keys():
self.toonSDs[avId].exit()
self.hidePosts()
self.hideDropGrid()
for collNode in self.toonCollNodes:
while collNode.node().getNumSolids():
collNode.node().removeSolid(0)
base.localAvatar.cTrav.removeCollider(collNode)
del self.toonCollNodes
for panel in self.scorePanels:
panel.cleanup()
del self.scorePanels
self.ground.reparentTo(hidden)
DistributedMinigame.offstage(self)
示例11: onstage
def onstage(self):
self.notify.debug('onstage')
DistributedMinigame.onstage(self)
base.localAvatar.collisionsOff()
DistributedSmoothNode.activateSmoothing(1, 1)
numToons = self.numPlayers
self.NUMTREASURES = numToons
camera.reparentTo(render)
camera.setZ(36)
camera.setHpr(0,0,0)
camera.setX(0)
base.camLens.setFov(45)
camera.setY(-54)
base.camLens.setFar(1500)
self.introMovie = self.getIntroMovie()
self.introMovie.start()
self.accept('FishHit', self.fishCollision)
toonSD = self.toonSDs[self.localAvId]
toonSD.enter()
toonSD.fsm.request('normal')
toon = base.localAvatar
toon.reparentTo(render)
toon.setPos(-9, -1, 36)
self.__placeToon(self.localAvId)
self.arrowKeys = ArrowKeys.ArrowKeys()
self.xVel = 0
self.zVel = 0
self.orientNode = toon.attachNewNode('orientNode')
self.orientNode.setPos(0, 0, 1)
self.orientNode2 = toon.attachNewNode('orientNode')
self.orientNode2.setPos(0, 0, -1)
self.environNode = render.attachNewNode('environNode')
self.environModel.reparentTo(self.environNode)
self.environModel.setScale(2.8, 2.8, 2.73)
self.environModel.setPos(0, 0.5, -41)
self.skyModel.setScale(1.3, 1.0, 1.0)
boatoff = 6.75
self.boatModel.reparentTo(self.environNode)
self.boatModel.setPos(0, 3.0, 40 - boatoff)
self.boatModel.setScale(2.8)
cSphere = CollisionSphere(0.0, 0.0, 0.0 + 2.0, 3.0)
cSphere.setTangible(0)
name = 'boat'
cSphereNode = CollisionNode(name)
cSphereNode.setIntoCollideMask(DivingGameGlobals.CollideMask)
cSphereNode.addSolid(cSphere)
self.boatNode = cSphereNode
self.boatCNP = self.boatModel.attachNewNode(cSphereNode)
self.accept('reach-boat', self.__boatReached)
self.boatTilt = Sequence(LerpFunc(self.boatModel.setR, duration=5, fromData=5, toData=-5, blendType='easeInOut', name='tilt'), LerpFunc(self.boatModel.setR, duration=5, fromData=-5, toData=5, blendType='easeInOut', name='tilt'))
self.boatTilt.loop()
self.mapScaleRatio = 40
self.mapModel.reparentTo(base.a2dTopRight)
self.mapModel.setScale(1.0 / self.mapScaleRatio)
self.mapModel.setTransparency(1)
self.mapModel.setPos(-0.22, 0.0, -1.30)
self.mapModel.setColorScale(1, 1, 1, 0.7)
self.mapModel.hide()
if self.sndAmbience:
self.sndAmbience.setLoop(True)
self.sndAmbience.play()
self.sndAmbience.setVolume(0.01)
return