1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-02 16:48:55 +00:00

Physics Interpolation - refactor Camera and fix get_camera_transform()

* Moves 3D Camera interpolation scene side.
* Automatically switches `get_camera_transform()` to report interpolated transform during `_process()`.
* Fixes `ClippedCamera` to work with physics interpolation.
This commit is contained in:
lawnjelly
2024-06-05 07:45:03 +01:00
parent b203829361
commit 0b30d77384
20 changed files with 359 additions and 274 deletions

View File

@@ -900,14 +900,6 @@ void CPUParticles::_particles_process(float p_delta) {
p.velocity.z = 0.0;
p.transform.origin.z = 0.0;
}
// Teleport if starting a new particle, so
// we don't get a streak from the old position
// to this new start.
if (_interpolated) {
p.copy_to(particles_prev[i]);
}
} else if (!p.active) {
continue;
} else if (p.time > p.lifetime) {
@@ -1012,6 +1004,13 @@ void CPUParticles::_particles_process(float p_delta) {
}
p.transform.origin += p.velocity * local_delta;
// Teleport if starting a new particle, so
// we don't get a streak from the old position
// to this new start.
if (restart && _interpolated) {
p.copy_to(particles_prev[i]);
}
}
}