示例#1
0
 def update(self):
     ParticleGroup.update(self)
     if engine.clock.time - self.lastSpawn >= self.lifeTime:
         self.delete()
     if self.active and ParticleGroup.begun:
         if engine.clock.time - self.lastPositionUpdate < 0.1:
             if self.lastPosition != None:
                 vector = self.position - self.lastPosition
                 distance = vector.length()
                 if distance > 0:
                     vector /= distance
                     for f in engine.frange(0.0, distance, self.interval):
                         self.spawnParticle(self.position + (vector * f))
                 else:
                     self.spawnParticle(self.position)
示例#2
0
文件: particles.py 项目: etodd/a3p
	def update(self):
		ParticleGroup.update(self)
		if engine.clock.time - self.lastSpawn >= self.lifeTime:
			self.delete()
		if self.active and ParticleGroup.begun:
			if engine.clock.time - self.lastPositionUpdate < 0.1:
				if self.lastPosition != None:
					vector = self.position - self.lastPosition
					distance = vector.length()
					if distance > 0:
						vector /= distance
						for f in engine.frange(0.0, distance, self.interval):
							self.spawnParticle(self.position + (vector * f))
					else:
						self.spawnParticle(self.position)
示例#3
0
文件: particles.py 项目: etodd/a3p
	def update(self):
		ParticleGroup.update(self)
		if self.isIndependent and engine.clock.time - self.lastSpawn >= self.lifeTime:
			self.delete()
		if self.active and ParticleGroup.begun:
			if engine.clock.time - self.lastPositionUpdate < 0.1 and engine.clock.time - self.lastSpawn > 0.01:
				if self.lastPosition != None:
					vector = self.position - self.lastPosition
					distance = vector.length()
					if distance > 0 and distance < 4.0:
						vector /= distance
						points = engine.frange(0.0, distance, self.interval)
						for f in points:
							self.spawnParticle(self.position + (vector * f) + (Vec3(uniform(-1.0, 1.0), uniform(-1.0, 1.0), uniform(-1.0, 1.0)) * 0.5))
					else:
						self.spawnParticle(self.position + Vec3(uniform(-1.0, 1.0), uniform(-1.0, 1.0), 0) * 0.5)
示例#4
0
 def update(self):
     ParticleGroup.update(self)
     if self.isIndependent and engine.clock.time - self.lastSpawn >= self.lifeTime:
         self.delete()
     if self.active and ParticleGroup.begun:
         if engine.clock.time - self.lastPositionUpdate < 0.1 and engine.clock.time - self.lastSpawn > 0.01:
             if self.lastPosition != None:
                 vector = self.position - self.lastPosition
                 distance = vector.length()
                 if distance > 0 and distance < 4.0:
                     vector /= distance
                     points = engine.frange(0.0, distance, self.interval)
                     for f in points:
                         self.spawnParticle(self.position + (vector * f) + (
                             Vec3(uniform(-1.0, 1.0), uniform(-1.0, 1.0),
                                  uniform(-1.0, 1.0)) * 0.5))
                 else:
                     self.spawnParticle(
                         self.position +
                         Vec3(uniform(-1.0, 1.0), uniform(-1.0, 1.0), 0) *
                         0.5)