本文整理汇总了C++中ParticleSystem::SetMinSpawnPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleSystem::SetMinSpawnPosition方法的具体用法?C++ ParticleSystem::SetMinSpawnPosition怎么用?C++ ParticleSystem::SetMinSpawnPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem::SetMinSpawnPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void Dragon_Dogs_ParticleSystem::Init(Scene * scene)
{
StaticEntityPtr skyPtr = scene->AddStaticEntity("assets/sphere.smodel", "sky");
StaticEntity * sky = skyPtr.Get();
sky->Illuminate(false);
sky->SetScale(10000, 10000, 10000);
Material * m = sky->GetMaterial(0);
m->SetDiffuseMap("assets/risinger.jpg");
m->UseDiffuseMap(true);
psPtr = scene->AddParticleSystem();
ParticleSystem * ps = psPtr.Get();
ps->SetColorTexture("assets/fire.png");
ps->SetEmmiterPosition(Vector3(45.0f, 0.0f, 0.0f));
ps->SetMinSpawnPosition(Vector3(-1.0f, 0.0f, 0.0f));
ps->SetMaxSpawnPosition(Vector3(1.0f, 0.0f, 0.0f));
ps->SetMaxLifeTime(70);
ps->SetMinLifeTime(50);
ps->SetMaxParticles(70);
ps->SetSpawnTime(4.0);
ps->SetMinSize(10);
ps->SetMaxSize(14);
////entitiy->SetPosition(10.0f,0.0f,0.0f);
drPtr = scene->AddParticleSystem();
ps = drPtr.Get();
ps->SetColorTexture("assets/fire.png");
ps->SetEmmiterPosition(Vector3(-30.0f, 150.0, 10.0f));
ps->SetMinSpawnPosition(Vector3(-0.2f, 0.3f, 0.0f));
ps->SetMaxSpawnPosition(Vector3(0.2f, -0.3f, 0.0f));
ps->SetMinSpawnVelocity(Vector3(-1.0f, -2.0f, -1.8f));
ps->SetMaxSpawnVelocity(Vector3(1.0f, -2.0f, -1.0f));
ps->SetMaxLifeTime(30);
ps->SetMinLifeTime(45);
ps->SetMaxParticles(70);
ps->SetSpawnTime(4.0);
ps->SetMinSize(10);
ps->SetMaxSize(14);
ps->AllowParticleAdd(false);
plDragon = scene->AddPointLight();
PointLight * plD = plDragon.Get();
plD->SetDiffuse(1.0f, 0.4f, 0.0f, 1.0f);
plD->SetRange(1.0f);
plD->SetPosition(-30.0f, 150.0, 10.0f);
dragonTime = 0;
dragonOn = false;
enPtr = scene->AddAnimatedEntity("assets/ninja.model", "ninja");
AnimatedEntity * en = enPtr.Get();
en->SetPosition(0.0f, 0.0f, 0.0f);
en->Illuminate(true);
en->SetScale(10.0f, 10.0f, 10.0f);
en->SetPosZ(-100);
//en->SetRotationY(90.0f);
Material * mat = en->GetMaterial(0);
mat->UseDiffuseMap(true);
mat->SetDiffuseColor(Color::White());
mat->SetDiffuseMap("assets/nskin.jpg");
mat->SetEmmisivePower(1);
mat->SetSpecularPower(0);
mat->SetSpecularIntesity(0);
mat = en->GetMaterial(1);
mat->UseDiffuseMap(false);
mat->SetEmmisivePower(1);
mat->SetSpecularIntesity(0);
mat->SetSpecularPower(0);
mat->SetDiffuseColor(Color(0.3f, 0.3f, 0.3f, 1.0f));
pointLight = scene->AddPointLight();
PointLight * p = pointLight.Get();
p->SetDiffuse(1.0f, 0.4f, 0.0f, 1.0f);
p->SetRange(500.0f);
p->SetPosition(45.0f, 4.0f, 0.0f);
planePtr = scene->AddStaticEntity("assets/plane.model", "plane");
StaticEntity * plane = planePtr.Get();
plane->Illuminate(true);
plane->SetScale(500.0f, 1.0f, 500.0f);
Material * pMat = plane->GetMaterial(0);
pMat->UseDiffuseMap(false);
pMat->SetDiffuseColor(Color(0.3f, 0.3f, 0.3f, 1.0f));
pMat->SetEmmisivePower(1);
pMat->SetSpecularPower(0);
pMat->SetSpecularIntesity(0);
plane->SetPosition(0.0f, -7.0f, 0.0f);
dogPtr = scene->AddStaticEntity("assets/dog.smodel", "dog");
StaticEntity * dog = dogPtr.Get();
//.........这里部分代码省略.........