本文整理汇总了Python中direct.particles.ParticleEffect.ParticleEffect.setDepthTest方法的典型用法代码示例。如果您正苦于以下问题:Python ParticleEffect.setDepthTest方法的具体用法?Python ParticleEffect.setDepthTest怎么用?Python ParticleEffect.setDepthTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.particles.ParticleEffect.ParticleEffect
的用法示例。
在下文中一共展示了ParticleEffect.setDepthTest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __createToonInterval
# 需要导入模块: from direct.particles.ParticleEffect import ParticleEffect [as 别名]
# 或者: from direct.particles.ParticleEffect.ParticleEffect import setDepthTest [as 别名]
def __createToonInterval(self, delay):
track = Sequence(Wait(delay))
sprayEffect = ParticleEffect()
sprayEffect.loadConfig('phase_5/etc/soundWave.ptf')
sprayEffect.setDepthWrite(0)
sprayEffect.setDepthTest(0)
sprayEffect.setTwoSided(1)
I1 = 2.8
track.append(ActorInterval(self.avatar, 'sound', playRate=1.0, startTime=0.0, endTime=I1))
track.append(Func(self.setPosFromOther, sprayEffect, self.gag, Point3(0, 1.6, -0.18)))
track.append(self.__getPartTrack(sprayEffect, 0.0, 6.0, [sprayEffect, self.avatar, 0], softStop=-3.5))
track.append(ActorInterval(self.avatar, 'sound', playRate=1.0, startTime=I1))
return track
示例2: damageCogsNearby
# 需要导入模块: from direct.particles.ParticleEffect import ParticleEffect [as 别名]
# 或者: from direct.particles.ParticleEffect.ParticleEffect import setDepthTest [as 别名]
def damageCogsNearby(self, radius = None):
if not radius:
radius = self.soundRange
suits = []
for obj in base.cr.doId2do.values():
if obj.__class__.__name__ == 'DistributedSuit':
if obj.getPlace() == base.localAvatar.zoneId:
if obj.getDistance(self.avatar) <= radius:
if self.avatar.doId == base.localAvatar.doId:
suits.append(obj)
def shouldContinue(suit, track):
if suit.isDead():
track.finish()
for suit in suits:
if self.name != CIGlobals.Opera:
self.avatar.sendUpdate('suitHitByPie', [suit.doId, self.getID()])
else:
breakEffect = ParticleEffect()
breakEffect.loadConfig('phase_5/etc/soundBreak.ptf')
breakEffect.setDepthWrite(0)
breakEffect.setDepthTest(0)
breakEffect.setTwoSided(1)
suitTrack = Sequence()
if suit.isDead():
return
suitTrack.append(Wait(2.5))
delayTime = random.random()
suitTrack.append(Wait(delayTime + 2.0))
suitTrack.append(Func(shouldContinue, suit, suitTrack))
suitTrack.append(Func(self.setPosFromOther, breakEffect, suit, Point3(0, 0, 0)))
suitTrack.append(SoundInterval(self.hitSfx, node=suit))
suitTrack.append(Func(self.avatar.sendUpdate, 'suitHitByPie', [suit.doId, self.getID()]))
suitTrack.start()
suits = None
return