ADD: Particle system floating origin fix

This commit is contained in:
2025-12-17 22:37:34 +09:00
parent 4fea967bfc
commit 12ac65c79a

View File

@@ -373,6 +373,16 @@ void ParticlePass::register_graph(RenderGraph *graph, RGImageHandle hdrTarget, R
_has_prev_origin = true;
}
const float origin_delta_len2 = glm::dot(_origin_delta_local, _origin_delta_local);
const bool origin_delta_valid = std::isfinite(origin_delta_len2) && origin_delta_len2 > 0.0f;
if (origin_delta_valid)
{
for (auto &sys : _systems)
{
sys.params.emitter_pos_local -= _origin_delta_local;
}
}
bool any_active = false;
for (const auto &s : _systems)
{