Add support for audio clip playback preview in editor window

This commit is contained in:
Wojtek Figat
2021-02-17 12:31:30 +01:00
parent 62bfc94f24
commit d88335c51f
2 changed files with 70 additions and 4 deletions

View File

@@ -342,7 +342,7 @@ void AudioSource::Update()
{
// Update the velocity
const Vector3 pos = GetPosition();
const float dt = Time::Update.UnscaledDeltaTime.GetTotalSeconds();
const float dt = Math::Max(Time::Update.UnscaledDeltaTime.GetTotalSeconds(), ZeroTolerance);
const auto prevVelocity = _velocity;
_velocity = (pos - _prevPos) / dt;
_prevPos = pos;