本文整理汇总了C++中ParticleEmitter::getNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleEmitter::getNode方法的具体用法?C++ ParticleEmitter::getNode怎么用?C++ ParticleEmitter::getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEmitter
的用法示例。
在下文中一共展示了ParticleEmitter::getNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runtime_error
// ----------------------------------------------------------------------------
TrackObjectPresentationParticles::TrackObjectPresentationParticles(
const XMLNode& xml_node,
scene::ISceneNode* parent)
: TrackObjectPresentationSceneNode(xml_node)
{
m_emitter = NULL;
m_lod_emitter_node = NULL;
std::string path;
xml_node.get("kind", &path);
int clip_distance = -1;
xml_node.get("clip_distance", &clip_distance);
xml_node.get("conditions", &m_trigger_condition);
bool auto_emit = true;
xml_node.get("auto_emit", &auto_emit);
m_delayed_stop = false;
m_delayed_stop_time = 0.0;
#ifndef SERVER_ONLY
try
{
ParticleKind* kind = ParticleKindManager::get()->getParticles(path);
if (kind == NULL)
{
throw std::runtime_error(path + " could not be loaded");
}
ParticleEmitter* emitter = new ParticleEmitter(kind, m_init_xyz, parent);
if (clip_distance > 0)
{
scene::ISceneManager* sm = irr_driver->getSceneManager();
scene::ISceneNode* sroot = sm->getRootSceneNode();
LODNode* lod = new LODNode("particles", !parent ? sroot : parent, sm);
lod->add(clip_distance, (scene::ISceneNode*)emitter->getNode(), true);
m_node = lod;
m_lod_emitter_node = lod;
m_emitter = emitter;
}
else
{
m_node = emitter->getNode();
m_emitter = emitter;
}
if (m_trigger_condition.size() > 0 || !auto_emit)
{
m_emitter->setCreationRateAbsolute(0.0f);
}
}
catch (std::runtime_error& e)
{
Log::warn ("Track", "Could not load particles '%s'; cause :\n %s",
path.c_str(), e.what());
}
#endif
} // TrackObjectPresentationParticles
示例2: runtime_error
TrackObjectPresentationParticles::TrackObjectPresentationParticles(const XMLNode& xml_node, scene::ISceneNode* parent) :
TrackObjectPresentationSceneNode(xml_node)
{
m_emitter = NULL;
m_lod_emitter_node = NULL;
std::string path;
xml_node.get("kind", &path);
int clip_distance = -1;
xml_node.get("clip_distance", &clip_distance);
xml_node.get("conditions", &m_trigger_condition);
try
{
ParticleKind* kind = ParticleKindManager::get()->getParticles( path.c_str() );
if (kind == NULL)
{
throw std::runtime_error(path + " could not be loaded");
}
ParticleEmitter* emitter = new ParticleEmitter(kind, m_init_xyz, parent);
if (clip_distance > 0)
{
scene::ISceneManager* sm = irr_driver->getSceneManager();
scene::ISceneNode* sroot = sm->getRootSceneNode();
LODNode* lod = new LODNode("particles", parent == NULL ? sroot : parent, sm);
lod->add(clip_distance, (scene::ISceneNode*)emitter->getNode(), true);
m_node = lod;
m_lod_emitter_node = lod;
m_emitter = emitter;
}
else
{
m_node = emitter->getNode();
m_emitter = emitter;
}
if (m_trigger_condition.size() > 0)
{
m_emitter->setCreationRateAbsolute(0.0f);
}
}
catch (std::runtime_error& e)
{
fprintf(stderr, "[Track] WARNING: Could not load particles '%s'; cause :\n %s", path.c_str(), e.what());
}
}