当前位置: 首页>>代码示例>>C++>>正文


C++ ParticleSystem::SetTexture方法代码示例

本文整理汇总了C++中ParticleSystem::SetTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleSystem::SetTexture方法的具体用法?C++ ParticleSystem::SetTexture怎么用?C++ ParticleSystem::SetTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParticleSystem的用法示例。


在下文中一共展示了ParticleSystem::SetTexture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LaunchPoisonExplosion

void LaunchPoisonExplosion(Vec3f * aePos) {
	
	// système de partoches pour l'explosion
	ParticleSystem * pPS = new ParticleSystem();
	ParticleParams cp;
	cp.iNbMax = 80; 
	cp.fLife = 1500;
	cp.fLifeRandom = 500;
	cp.p3Pos = Vec3f::repeat(5);
	cp.p3Direction.x = 0;
	cp.p3Direction.y = 4;
	cp.p3Direction.z = 0;
	cp.fAngle = radians(360);
	cp.fSpeed = 200;
	cp.fSpeedRandom = 0;
	cp.p3Gravity.x = 0;
	cp.p3Gravity.y = 17;
	cp.p3Gravity.z = 0;
	cp.fFlash = 0;
	cp.fRotation = 80;
	cp.bRotationRandomDirection = true;
	cp.bRotationRandomStart = true;

	cp.fStartSize = 5;
	cp.fStartSizeRandom = 3;
	cp.fStartColor[0] = 0;
	cp.fStartColor[1] = 76;
	cp.fStartColor[2] = 0;
	cp.fStartColor[3] = 0;
	cp.fStartColorRandom[0] = 0;
	cp.fStartColorRandom[1] = 0;
	cp.fStartColorRandom[2] = 0;
	cp.fStartColorRandom[3] = 150; 
	cp.bStartLock = false;

	cp.fEndSize = 30;
	cp.fEndSizeRandom = 5;
	cp.fEndColor[0] = 0;
	cp.fEndColor[1] = 0;
	cp.fEndColor[2] = 0;
	cp.fEndColor[3] = 0;
	cp.fEndColorRandom[0] = 0;
	cp.fEndColorRandom[1] = 25; 
	cp.fEndColorRandom[2] = 0;
	cp.fEndColorRandom[3] = 20; 
	cp.bEndLock = false;

	cp.iBlendMode = 3;
	cp.iFreq = -1;
	cp.bTexInfo = false;
	pPS->SetParams(cp);
	pPS->ulParticleSpawn = 0;
	pPS->SetTexture("graph/particles/big_greypouf", 0, 200);

	pPS->SetPos(*aePos);
	pPS->Update(0);
	pPS->iParticleNbMax = 0;

	std::list<Particle *>::iterator i;

	for (i = pPS->listParticle.begin(); i != pPS->listParticle.end(); ++i)
	{
		Particle * pP = *i;

		if (pP->isAlive())
		{
			if (pP->p3Velocity.y >= 0.5f * 200)
				pP->p3Velocity.y = 0.5f * 200;

			if (pP->p3Velocity.y <= -0.5f * 200)
				pP->p3Velocity.y = -0.5f * 200;
		}
	}

	if (pParticleManager)
	{
		pParticleManager->AddSystem(pPS);
	}
}
开发者ID:Eli2,项目名称:ArxLibertatis,代码行数:79,代码来源:Spells05.cpp

示例2: Create

//-----------------------------------------------------------------------------
//!!!!!!! def non impair
void CParalyse::Create(int adef, float arayon, float ahcapuchon, float ahauteur, Vec3f * aePos, int aduration)
{
	if(adef < 3)
		return;

	key = -1;
	pos = *aePos;
	currduration = colduration = 0;
	duration = aduration;
	prisminterpcol = 0.f;
	r = arayon;

	SetColPrismDep(128.f, 128.f, 128.f);
	SetColPrismEnd(100.f, 100.f, 128.f);

	prismnbpt = 1 + (adef << 1);
	prismnbface = adef + (adef << 1);
	prismd3d = new TexturedVertex[prismnbpt];
	prismvertex = new Vec3f[prismnbpt];
	prismind = new unsigned short [prismnbface*3];

	for(int i = 0; i < 100; i++) {
		tabprism[i].vertex = new Vec3f[prismnbpt];
	}

	tex_prism = TextureContainer::Load("graph/obj3d/textures/(fx)_paralyze");
	tex_p	  = TextureContainer::Load("graph/particles/missile");
	tex_p1	  = TextureContainer::Load("graph/obj3d/textures/(fx)_tsu_blueting");
	tex_p2	  = TextureContainer::Load("graph/obj3d/textures/(fx)_tsu_bluepouf");

	CreatePrismTriangleList(arayon, ahcapuchon, ahauteur, adef);
	CreateLittlePrismTriangleList();

	if(lLightId >= 0) {
		int id = lLightId;
		DynLight[id].exist = 1;
		DynLight[id].intensity = 1.4f + 4.f * rnd();
		DynLight[id].fallend = r * 3.f;
		DynLight[id].fallstart = r * 3.f * .75f;
		DynLight[id].rgb.r = (prismrd * 2.f) / 255.f;
		DynLight[id].rgb.g = (prismgd * 2.f) / 255.f;
		DynLight[id].rgb.b = (prismbd * 2.f) / 255.f;
		DynLight[id].pos.x = pos.x;
		DynLight[id].pos.y = pos.y - ahcapuchon * .5f;
		DynLight[id].pos.z = pos.z;
	}

	// système de partoches pour la poussière
	ParticleSystem * pPS = new ParticleSystem();
	ParticleParams cp;
	memset(&cp, 0, sizeof(cp));
	cp.iNbMax = 200;
	cp.fLife = 500; //2000
	cp.fLifeRandom = 900;
	cp.p3Pos.x = 20;
	cp.p3Pos.y = 80;
	cp.p3Pos.z = 20;
	cp.p3Direction.x = 0;
	cp.p3Direction.y = -10;
	cp.p3Direction.z = 0;
	cp.fAngle = radians(360);
	cp.fSpeed = 10;
	cp.fSpeedRandom = 10;
	cp.p3Gravity.x = 0;
	cp.p3Gravity.y = 10;
	cp.p3Gravity.z = 0;
	cp.fFlash = 0;
	cp.fRotation = 0;

	cp.fStartSize = 0;
	cp.fStartSizeRandom = 1; 
	cp.fStartColor[0] = 20;
	cp.fStartColor[1] = 20;
	cp.fStartColor[2] = 20;
	cp.fStartColor[3] = 50;
	cp.fStartColorRandom[0] = 0;
	cp.fStartColorRandom[1] = 0;
	cp.fStartColorRandom[2] = 0;
	cp.fStartColorRandom[3] = 50;

	cp.fEndSize = 1; 
	cp.fEndSizeRandom = 4;
	cp.fEndColor[0] = 20;
	cp.fEndColor[1] = 20;
	cp.fEndColor[2] = 20;
	cp.fEndColor[3] = 10;
	cp.fEndColorRandom[0] = 0;
	cp.fEndColorRandom[1] = 0;
	cp.fEndColorRandom[2] = 0;
	cp.fEndColorRandom[3] = 0;

	cp.iBlendMode = 5;

	pPS->SetParams(cp);
	pPS->ulParticleSpawn = 0;
	pPS->SetTexture("graph/particles/lil_greypouf", 0, 200);

	Vec3f ep;
//.........这里部分代码省略.........
开发者ID:EstrangedGames,项目名称:ArxLibertatis,代码行数:101,代码来源:Spells06.cpp

示例3: LaunchMagicMissileExplosion

void LaunchMagicMissileExplosion(const Vec3f & _ePos, int t = 0, long spellinstance = -1)
{
	// système de partoches pour l'explosion
	ParticleSystem * pPS = new ParticleSystem();
	ParticleParams cp;
	memset(&cp, 0, sizeof(cp));
	cp.iNbMax = 100 + t * 50;
	cp.fLife = 1500;
	cp.fLifeRandom = 0;
	cp.p3Pos = Vec3f(10.f);
	cp.p3Direction = Vec3f(0.f, -10.f, 0.f);
	cp.fAngle = radians(360);
	cp.fSpeed = 130;
	cp.fSpeedRandom = 100;
	cp.p3Gravity = Vec3f(0.f, 10.f, 0.f);
	cp.fFlash = 0;
	cp.fRotation = 16;

	cp.fStartSize = 5;
	cp.fStartSizeRandom = 10;


	cp.fEndSize = 0;
	cp.fEndSizeRandom = 2;

	if(spellinstance >= 0 && spells[spellinstance].caster == 0 && cur_mr == 3) {
		cp.fStartSize = 20;
		cp.fSpeed = 13;
		cp.fSpeedRandom = 10;
		cp.fStartColorRandom[0] = 0;
		cp.fStartColorRandom[1] = 0;
		cp.fStartColorRandom[2] = 0;
		cp.fStartColorRandom[3] = 0;

		cp.fStartColor[0] = 0;
		cp.fStartColor[1] = 0;
		cp.fStartColor[2] = 0;
		cp.fStartColor[3] = 0;
		cp.fEndColor[0] = 255;
		cp.fEndColor[1] = 40;
		cp.fEndColor[2] = 120;
		cp.fEndColor[3] = 10;//55;
		pPS->SetTexture("graph/particles/(fx)_mr", 0, 500);
	} else {
		cp.fStartColorRandom[0] = 100;
		cp.fStartColorRandom[1] = 100;
		cp.fStartColorRandom[2] = 100;
		cp.fStartColorRandom[3] = 100;

		cp.fStartColor[0] = 110;
		cp.fStartColor[1] = 110;
		cp.fStartColor[2] = 110;
		cp.fStartColor[3] = 110;
		cp.fEndColor[0] = 0;
		cp.fEndColor[1] = 0;
		cp.fEndColor[2] = 120;
		cp.fEndColor[3] = 10;
		pPS->SetTexture("graph/particles/magicexplosion", 0, 500);
	}

	cp.fEndColorRandom[0] = 50;
	cp.fEndColorRandom[1] = 50;
	cp.fEndColorRandom[2] = 50;
	cp.fEndColorRandom[3] = 50;

	cp.blendMode = RenderMaterial::Additive;

	pPS->SetParams(cp);
	pPS->ulParticleSpawn = 0;
	
	Vec3f eP = _ePos;
	
	pPS->SetPos(eP);
	pPS->Update(0);
	pPS->iParticleNbMax = 0;

	long id = GetFreeDynLight();

	if(id != -1) {
		DynLight[id].exist = 1;
		DynLight[id].intensity = 2.3f;
		DynLight[id].fallstart = 250.f;
		DynLight[id].fallend   = 420.f;

		if(spellinstance >= 0 && spells[spellinstance].caster == 0 && cur_mr == 3) {
			DynLight[id].rgb.r = 1.f;
			DynLight[id].rgb.g = 0.3f;
			DynLight[id].rgb.b = .8f;
		} else {
			DynLight[id].rgb.r = 0.f;
			DynLight[id].rgb.g = 0.f;
			DynLight[id].rgb.b = .8f;
		}

		DynLight[id].pos = eP;
		DynLight[id].duration = 1500;
	}

	if(pParticleManager)
		pParticleManager->AddSystem(pPS);
//.........这里部分代码省略.........
开发者ID:zhaozw,项目名称:ArxLibertatis,代码行数:101,代码来源:Spells01.cpp


注:本文中的ParticleSystem::SetTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。