*** empty log message ***

This commit is contained in:
Mike Goslin 2001-01-27 00:47:00 +00:00
parent e34085f5fa
commit 0ac40455aa
10 changed files with 56 additions and 8 deletions

View 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()

View File

@ -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):

View File

@ -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 ##

View File

@ -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);
}
////////////////////////////////////////////////////////////////////

View File

@ -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;
}

View File

@ -20,11 +20,12 @@ protected:
AngularForce(void);
AngularForce(const AngularForce &copy);
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) {

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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);
}
////////////////////////////////////////////////////////////////////