Skip to content

Commit

Permalink
Added scale
Browse files Browse the repository at this point in the history
  • Loading branch information
Fireronin committed Aug 14, 2024
1 parent 264f6dd commit 9426763
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9426763

Please sign in to comment.