emitter: zero delta time fix
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace wi
|
||||
|
||||
float emit = 0.0f;
|
||||
int burst = 0;
|
||||
float dt = 0;
|
||||
|
||||
uint32_t MAX_PARTICLES = 1000;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user