Commit aed6a515 authored by AL's avatar AL

Added some background smoke

parent 351aa5e6
......@@ -282,6 +282,35 @@ void EffectHandler::AddEffect3D(PositionData posData, Effect e)
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
break;
}
case EffectHandler::Effect::AmbientPemanentBackgroundSmoke: //is called by EffectHandler::AddEffect3D(Effect e)
{
ParticleSpreadData psd{
{1.4f*PI, 3.0f * PI / 2.0f, PI},
{1.6f*PI, 3.0f * PI / 2.0f, PI },
{ -1.9f, -0.01f, -0.0f},
{ -1.0f, 0.01f, 0.0f} };
ParticleBurstData pbd{ 1u, posData, 0.1f, 0.3f, 9999999999.0f, 0.99f };
pbd.origin.pos.z -= 1.8f;
pbd.origin.pos.y -= 0.8f;
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
pbd.origin.pos.y += 1.6f;
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
pbd.origin.pos.z += 3.6f;
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
pbd.origin.pos.y -= 1.6f;
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
pbd.origin.pos.y += 0.5f;
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
pbd.origin.pos.y += 1.0f;
pbd.origin.pos.z += 0.5f;
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
pbd.origin.pos.z -= 4.0f;
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
pbd.origin.pos.y += 0.5f;
e3df.push_back(std::make_unique<Effect3DPhysics>(pbd, psd, L"Media\\Models\\Player_SandStorm.obj", *gfx));
break;
}
default:
break;
}
......@@ -370,6 +399,11 @@ void EffectHandler::AddEffect3D(Effect e)
EH::AddScenario(EffectScenario::EffectStep::PlayerSandStorm,20u,0.04f);
break;
}
case Effect::AmbientPemanentBackgroundSmoke: //is called byLevelLayoutConstructor
{
EH::AddScenario(EffectScenario::EffectStep::AmbientPemanentBackgroundSmoke, 99999999u, 99999999.0f);
break;
}
default:
assert(false && "no such 3D effect exists");
break;
......@@ -592,7 +626,8 @@ bool EffectScenario::Execute(float dt)
case EffectStep::PlayerSandStorm:
EH::AddEffect3D({ RU.GetFloat(2.0f,7.0f), -0.2f, RU.GetFloat(0.0f,2.0f) }, EH::Effect::PlayerSandStorm);
break;
default:
case EffectStep::AmbientPemanentBackgroundSmoke:
EH::AddEffect3D({ 8.2f, 1.0f, 1.0f }, EH::Effect::AmbientPemanentBackgroundSmoke);
break;
}
}
......
......@@ -177,7 +177,8 @@ public:
enum class EffectStep
{
PlayerSandThrow,
PlayerSandStorm
PlayerSandStorm,
AmbientPemanentBackgroundSmoke
};
EffectScenario(EffectStep e, size_t timesRepeat, float delay);
EffectScenario(EffectScenario&&) = default;
......@@ -209,18 +210,19 @@ public:
PlayerSwordAttackUpgraded,
PlayerSandThrowDamage,
PlayerSandThrow,
PlayerSandStorm
PlayerSandStorm,
AmbientPemanentBackgroundSmoke
};
EffectHandler(DXGraphics& gfx);
static void AddEffect2D(Effect2DSequence data, std::wstring spriteName);
static void AddEffect2D(PositionData posData, Effect e);
static void AddEffect2D(Effect e); //for effects that are always in the same location
static void AddEffect3D(Effect3DSequence data, std::wstring spriteName, bool camFacing = 0);
static void AddEffect3D(PositionData posData, Effect e);
static void AddEffect3D(Effect e); //for effects that are always in the same location
static void AddScenario(EffectScenario::EffectStep e, size_t timesRepeat, float delay);
static void SetNextAngle(float ang); //camera manager sets this when decides in what direction an action will be executed
void SubmitAndUpdate(FrameCommander& fc, float dt); //can be made a friend
static void AddEffect3D(PositionData posData, Effect e);
private:
static std::vector<std::unique_ptr<HudEffect<Effect2DSequence,HudElement>>> e2d; //uses pointers because HudElement cant be copied
static std::vector<std::unique_ptr<Effect2DPhysics>> e2df;
......
......@@ -160,6 +160,8 @@ LevelLayout::LevelLayout(DXGraphics& gfx, FrameCommander& fc, const CombatManage
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 7,2 });
AddEnemy(Enemy::Monster::Ghoul, { 4,1 });
EH::AddEffect3D(EH::Effect::AmbientPemanentBackgroundSmoke); //just adding permanent smoke
}
void LevelLayout::AddWall(Wall::Model mod, Wall::Type type, DirectX::XMFLOAT2 pos, Wall::Direction dir)
......
......@@ -5,7 +5,7 @@ newmtl Player_SandStorm
Ns 49.300000
Ka 1.000000 1.000000 1.000000
Kd 0.070000 0.100000 0.200000
Ks 0.020000 0.020000 0.020000
Ks 0.010000 0.010000 0.010000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment