mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
added accelerate() to allow the particle system to be 'jumped' forward without exploding
This commit is contained in:
parent
77b18a7c73
commit
ee6a0c7382
@ -556,9 +556,27 @@ class Particles(ParticleSystem):
|
||||
self.factory.getLifespanBase()+self.factory.getLifespanSpread()]
|
||||
birthRateRange = [self.getBirthRate()] * 3
|
||||
|
||||
print litterRange
|
||||
print lifespanRange
|
||||
print birthRateRange
|
||||
print 'Litter Ranges: ',litterRange
|
||||
print 'LifeSpan Ranges: ',lifespanRange
|
||||
print 'BirthRate Ranges: ',birthRateRange
|
||||
|
||||
return dict(zip(('min','median','max'),[l*s/b for l,s,b in zip(litterRange,lifespanRange,birthRateRange)]))
|
||||
|
||||
|
||||
def accelerate(self,time,stepCount = 1,stepTime=0.0):
|
||||
if stepTime == 0.0:
|
||||
stepTime = float(time)/stepCount
|
||||
remainder = 0.0
|
||||
else:
|
||||
stepCount = int(float(time)/stepTime)
|
||||
remainder = time-stepCount*stepTime
|
||||
|
||||
for step in range(stepCount):
|
||||
self.update(stepTime)
|
||||
base.physicsMgr.doPhysics(stepTime,self)
|
||||
|
||||
if(remainder):
|
||||
self.update(remainder)
|
||||
base.physicsMgr.doPhysics(remainder,self)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user