emitter: zero delta time fix

This commit is contained in:
Turánszki János
2023-11-19 08:14:57 +01:00
parent 70d06b38e1
commit 253473c9f0
3 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -328,6 +328,7 @@ namespace wi
void EmittedParticleSystem::UpdateCPU(const TransformComponent& transform, float dt)
{
this->dt = dt;
CreateSelfBuffers();
if (IsPaused() || dt == 0)
@@ -374,7 +375,7 @@ namespace wi
GraphicsDevice* device = wi::graphics::GetDevice();
device->EventBegin("UpdateEmittedParticles", cmd);
if (!IsPaused())
if (!IsPaused() && dt > 0)
{
EmittedParticleCB cb;
cb.xEmitterTransform.Create(worldMatrix);
@@ -698,7 +699,7 @@ namespace wi
wi::gpusortlib::Sort(MAX_PARTICLES, distanceBuffer, counterBuffer, PARTICLECOUNTER_OFFSET_CULLEDCOUNT, culledIndirectionBuffer, cmd);
}
if (!IsPaused())
if (!IsPaused() && dt > 0)
{
// finish updating, update draw argument buffer:
device->EventBegin("FinishUpdate", cmd);
+1
View File
@@ -60,6 +60,7 @@ namespace wi
float emit = 0.0f;
int burst = 0;
float dt = 0;
uint32_t MAX_PARTICLES = 1000;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wi::version
// minor features, major updates, breaking compatibility changes
const int minor = 71;
// minor bug fixes, alterations, refactors, updates
const int revision = 347;
const int revision = 348;
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);