This commit is contained in:
yangxiao 2015-04-15 16:44:40 +08:00
commit 6b50bc430a
4 changed files with 15 additions and 1 deletions

View File

@ -187,10 +187,13 @@ float PUAffector::getMass() const
void PUAffector::copyAttributesTo( PUAffector* affector )
{
affector->setName(_name);
affector->setAffectorType(_affectorType);
affector->_position = _position;
affector->_isEnabled = _isEnabled;
affector->_particleSystem = _particleSystem;
affector->_affectorScale = _affectorScale;
affector->_affectSpecialisation = _affectSpecialisation;
affector->_excludedEmitters = _excludedEmitters;
}
void PUAffector::addEmitterToExclude( const std::string& emitterName )

View File

@ -890,6 +890,10 @@ void PUEmitter::copyAttributesTo( PUEmitter* emitter )
emitter->setEmitterType(_emitterType);
emitter->setEmitsName(_emitsName);
emitter->setEmitsType(_emitsType);
emitter->_position = _position;
emitter->_isEnabled = _isEnabled;
emitter->_originEnabled = _originEnabled;
emitter->_originEnabledSet = _originEnabledSet;
emitter->_particleDirection = _particleDirection;
emitter->_originalParticleDirection = _originalParticleDirection;
emitter->_particleOrientation = _particleOrientation;

View File

@ -317,6 +317,7 @@ void PUObserver::copyAttributesTo( PUObserver* observer )
{
// Copy attributes
observer->setName(_name);
observer->setObserverType(_observerType);
observer->_particleTypeToObserve = _particleTypeToObserve;
observer->_particleTypeToObserveSet = _particleTypeToObserveSet;
observer->_particleSystem = _particleSystem;

View File

@ -1051,7 +1051,8 @@ void PUParticleSystem3D::copyAttributesTo( PUParticleSystem3D* system )
system->setName(_name);
system->_state = _state;
system->setRender(static_cast<PURender *>(_render)->clone());
if (_render)
system->setRender(static_cast<PURender *>(_render)->clone());
system->_particleQuota = _particleQuota;
system->_blend = _blend;
system->_keepLocal = _keepLocal;
@ -1102,6 +1103,11 @@ PUParticleSystem3D* PUParticleSystem3D::clone()
{
auto ps = PUParticleSystem3D::create();
copyAttributesTo(ps);
for (auto &iter : _children){
PUParticleSystem3D *child = dynamic_cast<PUParticleSystem3D *>(iter);
if (child)
ps->addChild(child->clone());
}
return ps;
}