mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
*** empty log message ***
This commit is contained in:
parent
d0ef0cff08
commit
ff7883c731
@ -30,21 +30,21 @@ class Forces(DirectObject):
|
|||||||
|
|
||||||
def enable(self):
|
def enable(self):
|
||||||
"""enable(self)"""
|
"""enable(self)"""
|
||||||
for i in self.node.getNumForces():
|
for i in range(self.node.getNumForces()):
|
||||||
f = self.node.getForce(i)
|
f = self.node.getForce(i)
|
||||||
if (f.isLinear() == 1):
|
if (f.isLinear() == 1):
|
||||||
physicsManager.addLinearForce(f)
|
physicsMgr.addLinearForce(f)
|
||||||
else:
|
else:
|
||||||
physicsManager.addAngularForce(f)
|
physicsMgr.addAngularForce(f)
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
"""disable(self)"""
|
"""disable(self)"""
|
||||||
for i in self.node.getNumForces():
|
for i in range(self.node.getNumForces()):
|
||||||
f = self.node.getForce(i)
|
f = self.node.getForce(i)
|
||||||
if (f.isLinear() == 1):
|
if (f.isLinear() == 1):
|
||||||
physicsManager.removeLinearForce(f)
|
physicsMgr.removeLinearForce(f)
|
||||||
else:
|
else:
|
||||||
physicsManager.removeAngularForce(f)
|
physicsMgr.removeAngularForce(f)
|
||||||
|
|
||||||
def __getItem__(self, index):
|
def __getItem__(self, index):
|
||||||
"""__getItem__(self, index)"""
|
"""__getItem__(self, index)"""
|
||||||
|
@ -1,10 +1,24 @@
|
|||||||
from DirectSessionGlobal import *
|
from DirectSessionGlobal import *
|
||||||
|
|
||||||
import ParticleEffect
|
import ParticleEffect
|
||||||
|
import ParticlePanel
|
||||||
|
import Forces
|
||||||
|
|
||||||
|
# Showbase
|
||||||
|
base.enableParticles()
|
||||||
|
|
||||||
|
# Forces
|
||||||
|
gravity = LinearVectorForce(Vec3(0.0, 0.0, -10.0))
|
||||||
|
f = Forces.Forces()
|
||||||
|
f.addForce(gravity)
|
||||||
|
|
||||||
|
# Particle effect
|
||||||
pe = ParticleEffect.ParticleEffect('particle-fx')
|
pe = ParticleEffect.ParticleEffect('particle-fx')
|
||||||
pe.reparentTo(render)
|
pe.reparentTo(render)
|
||||||
pe.setPos(0.0, 5.0, 4.0)
|
pe.setPos(0.0, 5.0, 4.0)
|
||||||
import ParticlePanel
|
pe.addForces(f)
|
||||||
|
pe.enable()
|
||||||
|
|
||||||
|
# Particle Panel
|
||||||
p = pe.particles[0]
|
p = pe.particles[0]
|
||||||
ParticlePanel.ParticlePanel(pe, p)
|
ParticlePanel.ParticlePanel(pe, p)
|
||||||
base.enableParticles()
|
|
||||||
pe.enable()
|
|
||||||
|
@ -69,7 +69,7 @@ class Particles(ParticleSystem.ParticleSystem):
|
|||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
"""disable(self)"""
|
"""disable(self)"""
|
||||||
physicsMgr.removePhysical(self.node)
|
physicsMgr.removePhysical(self)
|
||||||
particleMgr.removeParticlesystem(self)
|
particleMgr.removeParticlesystem(self)
|
||||||
|
|
||||||
def setFactory(self, type):
|
def setFactory(self, type):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user