From 6b2380c5fab5504057522e43cc77e4520c728361 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sat, 28 Sep 2024 15:20:44 -0500 Subject: [PATCH] Add audio debug sphere for video player if spatial audio is used. --- Source/Engine/Video/VideoPlayer.cpp | 12 ++++++++++++ Source/Engine/Video/VideoPlayer.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/Source/Engine/Video/VideoPlayer.cpp b/Source/Engine/Video/VideoPlayer.cpp index 5bdcad7bf..80c0ed8ce 100644 --- a/Source/Engine/Video/VideoPlayer.cpp +++ b/Source/Engine/Video/VideoPlayer.cpp @@ -152,6 +152,18 @@ int32 VideoPlayer::GetFramesCount() const return _player.FramesCount; } +#if USE_EDITOR +#include "Engine/Debug/DebugDraw.h" + +void VideoPlayer::OnDebugDrawSelected() +{ + // Draw influence range + if (_isSpatial) + DEBUG_DRAW_WIRE_SPHERE(BoundingSphere(_transform.Translation, _minDistance), Color::CornflowerBlue, 0, true); + Actor::OnDebugDrawSelected(); +} +#endif + bool VideoPlayer::IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) { return false; diff --git a/Source/Engine/Video/VideoPlayer.h b/Source/Engine/Video/VideoPlayer.h index 87f75327b..02e751ac9 100644 --- a/Source/Engine/Video/VideoPlayer.h +++ b/Source/Engine/Video/VideoPlayer.h @@ -221,6 +221,8 @@ public: const Vector3 size(50); return BoundingBox(_transform.Translation - size, _transform.Translation + size); } + + void OnDebugDrawSelected() override; #endif bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;