update usages of vector scale on Transform to use uniform scale
This commit is contained in:
@@ -1298,10 +1298,10 @@ namespace MCommon
|
||||
|
||||
|
||||
// render a cube
|
||||
void RenderUtil::RenderCube(const AZ::Vector3& size, const AZ::Vector3& position, const MCore::RGBAColor& color)
|
||||
void RenderUtil::RenderCube(float size, const AZ::Vector3& position, const MCore::RGBAColor& color)
|
||||
{
|
||||
// setup the world space matrix of the cube
|
||||
AZ::Transform cubeTransform = AZ::Transform::CreateScale(size);
|
||||
AZ::Transform cubeTransform = AZ::Transform::CreateUniformScale(size);
|
||||
cubeTransform.SetTranslation(position);
|
||||
|
||||
// render the cube
|
||||
|
||||
@@ -303,7 +303,7 @@ namespace MCommon
|
||||
* @param position The position of the center of the cube.
|
||||
* @param color The desired cube color.
|
||||
*/
|
||||
void RenderCube(const AZ::Vector3& size, const AZ::Vector3& position, const MCore::RGBAColor& color);
|
||||
void RenderCube(float size, const AZ::Vector3& position, const MCore::RGBAColor& color);
|
||||
|
||||
/**
|
||||
* Render a triangle (CCW).
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace MCommon
|
||||
if (mXAxisVisible)
|
||||
{
|
||||
renderUtil->RenderLine(mPosition, mPosition + mSignX * AZ::Vector3(mScaledSize.GetX() + 0.5f * mBaseRadius, 0.0f, 0.0f), xAxisColor);
|
||||
//renderUtil->RenderCube( Vector3(mBaseRadius, mBaseRadius, mBaseRadius), mPosition + mSignX * Vector3(mScaledSize.x+mBaseRadius, 0, 0), ManipulatorColors::mRed );
|
||||
//renderUtil->RenderCube( mBaseRadius, mPosition + mSignX * Vector3(mScaledSize.x+mBaseRadius, 0, 0), ManipulatorColors::mRed );
|
||||
AZ::Vector3 quadPos = MCore::Project(mPosition + mSignX * AZ::Vector3(mScaledSize.GetX() + mBaseRadius, 0, 0), camera->GetViewProjMatrix(), screenWidth, screenHeight);
|
||||
renderUtil->RenderBorderedRect(static_cast<int32>(quadPos.GetX() - 2.0f), static_cast<int32>(quadPos.GetX() + 3.0f), static_cast<int32>(quadPos.GetY() - 2.0f), static_cast<int32>(quadPos.GetY() + 3.0f), ManipulatorColors::mRed, ManipulatorColors::mRed);
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace MCommon
|
||||
if (mYAxisVisible)
|
||||
{
|
||||
renderUtil->RenderLine(mPosition, mPosition + mSignY * AZ::Vector3(0.0f, mScaledSize.GetY(), 0.0f), yAxisColor);
|
||||
//renderUtil->RenderCube( Vector3(mBaseRadius, mBaseRadius, mBaseRadius), mPosition + mSignY * Vector3(0, mScaledSize.y+0.5*mBaseRadius, 0), ManipulatorColors::mGreen );
|
||||
//renderUtil->RenderCube( mBaseRadius, mPosition + mSignY * Vector3(0, mScaledSize.y+0.5*mBaseRadius, 0), ManipulatorColors::mGreen );
|
||||
AZ::Vector3 quadPos = MCore::Project(mPosition + mSignY * AZ::Vector3(0, mScaledSize.GetY() + 0.5f * mBaseRadius, 0), camera->GetViewProjMatrix(), screenWidth, screenHeight);
|
||||
renderUtil->RenderBorderedRect(static_cast<int32>(quadPos.GetX() - 2.0f), static_cast<int32>(quadPos.GetX() + 3.0f), static_cast<int32>(quadPos.GetY() - 2.0f), static_cast<int32>(quadPos.GetY() + 3.0f), ManipulatorColors::mGreen, ManipulatorColors::mGreen);
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace MCommon
|
||||
if (mZAxisVisible)
|
||||
{
|
||||
renderUtil->RenderLine(mPosition, mPosition + mSignZ * AZ::Vector3(0.0f, 0.0f, mScaledSize.GetZ()), zAxisColor);
|
||||
//renderUtil->RenderCube( Vector3(mBaseRadius, mBaseRadius, mBaseRadius), mPosition + mSignZ * Vector3(0, 0, mScaledSize.z+0.5*mBaseRadius), ManipulatorColors::mBlue );
|
||||
//renderUtil->RenderCube( mBaseRadius, mPosition + mSignZ * Vector3(0, 0, mScaledSize.z+0.5*mBaseRadius), ManipulatorColors::mBlue );
|
||||
AZ::Vector3 quadPos = MCore::Project(mPosition + mSignZ * AZ::Vector3(0, 0, mScaledSize.GetZ() + 0.5f * mBaseRadius), camera->GetViewProjMatrix(), screenWidth, screenHeight);
|
||||
renderUtil->RenderBorderedRect(static_cast<int32>(quadPos.GetX() - 2.0f), static_cast<int32>(quadPos.GetX() + 3.0f), static_cast<int32>(quadPos.GetY() - 2.0f), static_cast<int32>(quadPos.GetY() + 3.0f), ManipulatorColors::mBlue, ManipulatorColors::mBlue);
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace EMotionFX
|
||||
{
|
||||
#ifndef EMFX_SCALE_DISABLED
|
||||
mPosition = transform.GetTranslation();
|
||||
mScale = transform.GetScale();
|
||||
mScale = AZ::Vector3(transform.GetUniformScale());
|
||||
mRotation = transform.GetRotation();
|
||||
#else
|
||||
mPosition = transform.GetTranslation();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace MCore
|
||||
AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation(emfxTransform.mRotation, emfxTransform.mPosition);
|
||||
EMFX_SCALECODE
|
||||
(
|
||||
transform.MultiplyByScale(emfxTransform.mScale);
|
||||
transform.MultiplyByUniformScale(emfxTransform.mScale.GetMaxElement());
|
||||
)
|
||||
return transform;
|
||||
}
|
||||
@@ -386,7 +386,7 @@ namespace MCore
|
||||
AZ::Transform result;
|
||||
result.SetTranslation(translation);
|
||||
result.SetRotation(rotation);
|
||||
result.SetScale(scale);
|
||||
result.SetUniformScale(scale.GetMaxElement());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,9 +96,9 @@ namespace MCore
|
||||
// create the AABB of (box1 in space of box0)
|
||||
const AZ::Transform& mtx = _1in0.mRotation;
|
||||
|
||||
AZ::Vector3 transformedAxisX = mtx.GetScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisX()));
|
||||
AZ::Vector3 transformedAxisY = mtx.GetScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisY()));
|
||||
AZ::Vector3 transformedAxisZ = mtx.GetScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisZ()));
|
||||
AZ::Vector3 transformedAxisX = mtx.GetUniformScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisX()));
|
||||
AZ::Vector3 transformedAxisY = mtx.GetUniformScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisY()));
|
||||
AZ::Vector3 transformedAxisZ = mtx.GetUniformScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisZ()));
|
||||
|
||||
float f = transformedAxisX.GetAbs().Dot(mExtents) - box.mExtents.GetX();
|
||||
if (f > _1in0.mCenter.GetX())
|
||||
|
||||
Reference in New Issue
Block a user