void ParticleScene::Initialize(const GameContext& gameContext)
{
	UNREFERENCED_PARAMETER(gameContext);

	m_pRootObject = new GameObject();
	AddChild(m_pRootObject);

	auto particleObj = new GameObject();
	auto particleEmitter = new ParticleEmitterComponent(L"./Resources/Textures/Smoke.png", 60);
	particleEmitter->SetVelocity(XMFLOAT3(0, 6.0f, 0));
	particleEmitter->SetMinSize(1.0f);
	particleEmitter->SetMaxSize(2.0f);
	particleEmitter->SetMinEnergy(1.0f);
	particleEmitter->SetMaxEnergy(2.0f);
	particleEmitter->SetMinSizeGrow(3.5f);
	particleEmitter->SetMaxSizeGrow(5.5f);
	particleEmitter->SetMinEmitterRange(0.2f);
	particleEmitter->SetMaxEmitterRange(0.5f);
	particleEmitter->SetColor(XMFLOAT4(1.f, 1.f, 1.f, 0.6f));
	particleObj->AddComponent(particleEmitter);
	m_pRootObject->AddChild(particleObj);

	auto mat = new ColorMaterial();
	gameContext.pMaterialManager->AddMaterial(mat, 103);

	auto modelObj = new GameObject();
	auto model = new ModelComponent(L"./Resources/Meshes/Teapot.ovm");
	model->SetMaterial(103);
	modelObj->AddComponent(model);
	m_pRootObject->AddChild(modelObj);
	modelObj->GetTransform()->Scale(0.2f, 0.2f, 0.2f);
}
Пример #2
0
void Fire::Initialize(const GameContext& gameContext)
{
	auto particleObj = new GameObject();
	auto particleEmitter = new ParticleEmitterComponent(L"./Resources/Textures/Flames.png", 35);
	particleEmitter->SetVelocity(m_Velocity);
	particleEmitter->SetMinSize(3);
	particleEmitter->SetMaxSize(4);
	particleEmitter->SetMinEnergy(0.55f);
	particleEmitter->SetMaxEnergy(.85f);
	particleEmitter->SetMinSizeGrow(1.f);
	particleEmitter->SetMaxSizeGrow(1.5f);
	particleEmitter->SetMinEmitterRange(-1);
	particleEmitter->SetMaxEmitterRange(1);
	particleEmitter->SetColor(XMFLOAT4(1.f, 1.f, 1.f, 1.f));
	particleEmitter->SetActive(true);
	particleObj->AddComponent(particleEmitter);
	AddChild(particleObj);
}
Пример #3
0
void Laser::Initialize(const GameContext& gameContext)
{
	auto particleObj = new GameObject();
	auto particleEmitter = new ParticleEmitterComponent(L"./Resources/Textures/laser.png", 85);
	particleEmitter->SetVelocity(m_Velocity);
	particleEmitter->SetMinSize(1.75f);
	particleEmitter->SetMaxSize(1.75f);
	particleEmitter->SetMinEnergy(0.75f);
	particleEmitter->SetMaxEnergy(0.75f);
	particleEmitter->SetMinSizeGrow(1.f);
	particleEmitter->SetMaxSizeGrow(1.f);
	particleEmitter->SetMinEmitterRange(0);
	particleEmitter->SetMaxEmitterRange(0);
	particleEmitter->SetColor(XMFLOAT4(1.f, 1.f, 1.f, 1.f));
	particleEmitter->SetRandomRot(false);
	particleEmitter->SetActive(true);
	particleObj->AddComponent(particleEmitter);
	AddChild(particleObj);	
}