From 94267638f1c6ac2c255b8bf6b9b6ab1f59508bed Mon Sep 17 00:00:00 2001 From: Krzysztof Rymski Date: Wed, 14 Aug 2024 14:29:23 +0200 Subject: [PATCH] Added scale --- .../Components/PointcloudEditorComponent.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Gems/Pointcloud/Code/Source/Tools/Components/PointcloudEditorComponent.cpp b/Gems/Pointcloud/Code/Source/Tools/Components/PointcloudEditorComponent.cpp index 3db84b0..34667d1 100644 --- a/Gems/Pointcloud/Code/Source/Tools/Components/PointcloudEditorComponent.cpp +++ b/Gems/Pointcloud/Code/Source/Tools/Components/PointcloudEditorComponent.cpp @@ -66,17 +66,22 @@ namespace Pointcloud AZ::Aabb PointcloudEditorComponent::GetWorldBounds() const { - AZ::Vector3 position; - AZ::TransformBus::EventResult(position, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation); - return m_controller.GetBounds().GetTranslated(position); + AZ::Transform transform = AZ::Transform::CreateIdentity(); + AZ::TransformBus::EventResult(transform, GetEntityId(), &AZ::TransformBus::Events::GetWorldTM); + AZ::Aabb bounds = m_controller.GetBounds(); + bounds.ApplyTransform(transform); + return bounds; } - AZ::Aabb PointcloudEditorComponent::GetWorldBounds() const + AZ::Aabb PointcloudEditorComponent::GetLocalBounds() const { - AZ::Vector3 position; - AZ::TransformBus::EventResult(position, GetEntityId(), &AZ::TransformBus::Events::GetLocalTranslation); - return m_controller.GetBounds().GetTranslated(position); + AZ::Transform transform = AZ::Transform::CreateIdentity(); + AZ::TransformBus::EventResult(transform, GetEntityId(), &AZ::TransformBus::Events::GetLocalTM); + AZ::Aabb bounds = m_controller.GetBounds(); + bounds.ApplyTransform(transform); + return bounds; } + AZ::Aabb PointcloudEditorComponent::GetEditorSelectionBoundsViewport(const AzFramework::ViewportInfo& viewportInfo) { return GetWorldBounds();