apply minor feedback from PR
Signed-off-by: greerdv <greerdv@amazon.com>
This commit is contained in:
@@ -59,8 +59,8 @@ namespace AzToolsFramework
|
||||
if (auto& linearManipulator = m_linearManipulators[manipulatorIndex])
|
||||
{
|
||||
linearManipulator->SetSpace(boxWorldFromLocal);
|
||||
linearManipulator->SetLocalTransform(boxLocalTransform * AZ::Transform::CreateTranslation(
|
||||
s_boxAxes[manipulatorIndex] * 0.5f * boxDimensions));
|
||||
linearManipulator->SetLocalTransform(
|
||||
boxLocalTransform * AZ::Transform::CreateTranslation(s_boxAxes[manipulatorIndex] * 0.5f * boxDimensions));
|
||||
linearManipulator->SetNonUniformScale(nonUniformScale);
|
||||
linearManipulator->SetBoundsDirty();
|
||||
}
|
||||
@@ -88,7 +88,8 @@ namespace AzToolsFramework
|
||||
|
||||
ManipulatorViews views;
|
||||
views.emplace_back(CreateManipulatorViewQuadBillboard(
|
||||
AzFramework::ViewportColors::DefaultManipulatorHandleColor, AzFramework::ViewportConstants::DefaultManipulatorHandleSize));
|
||||
AzFramework::ViewportColors::DefaultManipulatorHandleColor,
|
||||
AzFramework::ViewportConstants::DefaultManipulatorHandleSize));
|
||||
linearManipulator->SetViews(AZStd::move(views));
|
||||
|
||||
linearManipulator->InstallMouseMoveCallback(
|
||||
@@ -105,7 +106,8 @@ namespace AzToolsFramework
|
||||
float boxScale = AZ::GetMax(AZ::MinTransformScale, boxWorldTransform.GetUniformScale());
|
||||
|
||||
// calculate the position of the manipulator in the reference frame of the box
|
||||
// the local position offset of the manipulator does not take the transform scale into account, so need to apply it here
|
||||
// the local position offset of the manipulator does not take the transform scale into account
|
||||
// so need to apply it here
|
||||
const AZ::Vector3 localPosition = boxLocalTransform.GetInverse().TransformPoint(
|
||||
action.m_start.m_localPosition + action.m_current.m_localPositionOffset / boxScale);
|
||||
|
||||
@@ -113,7 +115,7 @@ namespace AzToolsFramework
|
||||
// clamp movement so it cannot go negative based on axis direction
|
||||
const AZ::Vector3 axisDisplacement =
|
||||
localPosition.GetAbs() * 2.0f
|
||||
* AZ::GetMax<float>(0.0f, localPosition.GetNormalized().Dot(action.m_fixed.m_axis));
|
||||
* AZ::GetMax(0.0f, localPosition.GetNormalized().Dot(action.m_fixed.m_axis));
|
||||
|
||||
AZ::Vector3 boxDimensions = AZ::Vector3::CreateZero();
|
||||
BoxManipulatorRequestBus::EventResult(
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace LmbrCentral
|
||||
|
||||
TEST_F(EditorBoxShapeComponentManipulatorFixture, BoxShapeNonUniformScaleManipulatorsScaleCorrectly)
|
||||
{
|
||||
// a rotation which should map (1, 0, 0) to (0.8, 0.6, 0)
|
||||
// a rotation which rotates the x-axis to (0.8, 0.6, 0)
|
||||
const AZ::Quaternion boxRotation(0.0f, 0.0f, 0.316228f, 0.948683f);
|
||||
AZ::Transform boxTransform = AZ::Transform::CreateFromQuaternionAndTranslation(boxRotation, AZ::Vector3(2.0f, 3.0f, 4.0f));
|
||||
boxTransform.SetUniformScale(1.5f);
|
||||
@@ -132,7 +132,6 @@ namespace LmbrCentral
|
||||
|
||||
// enter the box shape component's component mode
|
||||
AzToolsFramework::SelectEntity(m_entity->GetId());
|
||||
|
||||
AzToolsFramework::ComponentModeFramework::ComponentModeSystemRequestBus::Broadcast(
|
||||
&AzToolsFramework::ComponentModeFramework::ComponentModeSystemRequestBus::Events::AddSelectedComponentModesOfType,
|
||||
EditorBoxShapeComponentTypeId);
|
||||
|
||||
Reference in New Issue
Block a user