本文整理汇总了C++中PUParticleSystem3D::startParticleSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ PUParticleSystem3D::startParticleSystem方法的具体用法?C++ PUParticleSystem3D::startParticleSystem怎么用?C++ PUParticleSystem3D::startParticleSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PUParticleSystem3D
的用法示例。
在下文中一共展示了PUParticleSystem3D::startParticleSystem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPropsWithFlatBuffers
Node* Particle3DReader::createNodeWithFlatBuffers(const flatbuffers::Table *particle3DOptions)
{
auto options = (Particle3DOptions*)particle3DOptions;
auto fileData = options->fileData();
std::string path = fileData->path()->c_str();
PUParticleSystem3D* ret = PUParticleSystem3D::create();
if (FileUtils::getInstance()->isFileExist(path))
{
ret->initWithFilePath(path);
}
setPropsWithFlatBuffers(ret, particle3DOptions);
if(ret)
{
ret->startParticleSystem();
}
return ret;
}
示例2: stopParticleSystem
void PUParticleSystem3D::startParticleSystem()
{
stopParticleSystem();
if (_state != State::RUNNING)
{
forceStopParticleSystem();
if (_render)
_render->notifyStart();
for (auto &it : _observers){
it->notifyStart();
}
for (auto& it : _emitters) {
auto emitter = static_cast<PUEmitter*>(it);
emitter->notifyStart();
}
for (auto& it : _affectors) {
auto affector = static_cast<PUAffector*>(it);
affector->notifyStart();
}
scheduleUpdate();
_state = State::RUNNING;
_latestPosition = getDerivedPosition(); // V1.3.1
}
for (auto iter : _children)
{
PUParticleSystem3D *system = dynamic_cast<PUParticleSystem3D *>(iter);
if (system){
system->_parentParticleSystem = this;
system->startParticleSystem();
}
}
}