mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
*** empty log message ***
This commit is contained in:
parent
e34085f5fa
commit
0ac40455aa
10
direct/src/particles/ParticleTest.py
Normal file
10
direct/src/particles/ParticleTest.py
Normal file
@ -0,0 +1,10 @@
|
||||
from DirectSessionGlobal import *
|
||||
import ParticleEffect
|
||||
pe = ParticleEffect.ParticleEffect('particle-fx')
|
||||
pe.reparentTo(render)
|
||||
pe.setPos(0.0, 5.0, 4.0)
|
||||
import ParticlePanel
|
||||
p = pe.particles[0]
|
||||
ParticlePanel.ParticlePanel(pe, p)
|
||||
base.enableParticles()
|
||||
pe.enable()
|
@ -64,7 +64,7 @@ class Particles(ParticleSystem.ParticleSystem):
|
||||
|
||||
def enable(self):
|
||||
"""enable(self)"""
|
||||
physicsMgr.attachPhysical(self.node)
|
||||
physicsMgr.attachPhysical(self)
|
||||
particleMgr.attachParticlesystem(self)
|
||||
|
||||
def disable(self):
|
||||
|
@ -658,9 +658,9 @@ class ParticlePanel(AppShell):
|
||||
|
||||
def toggleParticleSystem(self):
|
||||
if self.systemActive.get():
|
||||
self.particleEffect.activate()
|
||||
self.particleEffect.enable()
|
||||
else:
|
||||
self.particleEffect.deactivate()
|
||||
self.particleEffect.disable()
|
||||
return None
|
||||
|
||||
## SYSTEM PAGE ##
|
||||
|
@ -31,7 +31,11 @@ get_frame_stepping(void) const {
|
||||
INLINE void ParticleSystemManager::
|
||||
attach_particlesystem(ParticleSystem *ps) {
|
||||
ps->_manager = this;
|
||||
_ps_list.push_back(ps);
|
||||
list< PT(ParticleSystem) >::iterator found;
|
||||
PT(ParticleSystem) ptps = ps;
|
||||
found = find(_ps_list.begin(), _ps_list.end(), ptps);
|
||||
if (found == _ps_list.end())
|
||||
_ps_list.push_back(ps);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -46,3 +46,13 @@ get_vector(const PhysicsObject *po) {
|
||||
LVector3f v = get_child_vector(po);
|
||||
return v;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function : is_linear
|
||||
// Access : public
|
||||
// Description : access query
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool AngularForce::
|
||||
is_linear(void) const {
|
||||
return false;
|
||||
}
|
||||
|
@ -20,11 +20,12 @@ protected:
|
||||
AngularForce(void);
|
||||
AngularForce(const AngularForce ©);
|
||||
|
||||
public:
|
||||
PUBLISHED:
|
||||
virtual ~AngularForce(void);
|
||||
|
||||
virtual AngularForce *make_copy(void) const = 0;
|
||||
LVector3f get_vector(const PhysicsObject *po);
|
||||
virtual bool is_linear(void) const;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type(void) {
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
|
||||
INLINE bool get_active(void) const;
|
||||
INLINE void set_active(bool active);
|
||||
virtual bool is_linear(void) const = 0;
|
||||
|
||||
INLINE ForceNode *get_force_node(void) const;
|
||||
|
||||
|
@ -67,3 +67,12 @@ get_vector(const PhysicsObject *po) {
|
||||
|
||||
return child_vector;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function : is_linear
|
||||
// Access : Public
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool LinearForce::
|
||||
is_linear(void) const {
|
||||
return true;
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ PUBLISHED:
|
||||
|
||||
virtual LinearForce *make_copy(void) = 0;
|
||||
|
||||
virtual bool is_linear(void) const;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type(void) {
|
||||
return _type_handle;
|
||||
|
@ -11,7 +11,10 @@
|
||||
INLINE void PhysicsManager::
|
||||
attach_physical(Physical *p) {
|
||||
p->_physics_manager = this;
|
||||
_physicals.push_back(p);
|
||||
vector< Physical * >::iterator found;
|
||||
found = find(_physicals.begin(), _physicals.end(), p);
|
||||
if (found == _physicals.end())
|
||||
_physicals.push_back(p);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -21,7 +24,11 @@ attach_physical(Physical *p) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void PhysicsManager::
|
||||
add_linear_force(LinearForce *f) {
|
||||
_linear_forces.push_back(f);
|
||||
vector< PT(LinearForce) >::iterator found;
|
||||
PT(LinearForce) ptlf = f;
|
||||
found = find(_linear_forces.begin(), _linear_forces.end(), ptlf);
|
||||
if (found == _linear_forces.end())
|
||||
_linear_forces.push_back(f);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -52,7 +59,11 @@ clear_linear_forces(void) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void PhysicsManager::
|
||||
add_angular_force(AngularForce *f) {
|
||||
_angular_forces.push_back(f);
|
||||
vector< PT(AngularForce) >::iterator found;
|
||||
PT(AngularForce) ptaf = f;
|
||||
found = find(_angular_forces.begin(), _angular_forces.end(), ptaf);
|
||||
if (found == _angular_forces.end())
|
||||
_angular_forces.push_back(f);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user