refactor and tidy up

Signed-off-by: greerdv <greerdv@amazon.com>
This commit is contained in:
greerdv
2022-02-04 18:56:59 +00:00
parent a4d5587183
commit 8ca4dbf2da
3 changed files with 21 additions and 19 deletions
+12
View File
@@ -29,6 +29,7 @@
#include <AzFramework/Physics/HeightfieldProviderBus.h>
#include <PhysX/ColliderShapeBus.h>
#include <PhysX/EditorColliderComponentRequestBus.h>
#include <PhysX/SystemComponentBus.h>
#include <PhysX/MeshAsset.h>
#include <PhysX/Utils.h>
@@ -832,6 +833,17 @@ namespace PhysX
return AZ::Transform::CreateFromQuaternionAndTranslation(colliderRelativeRotation, colliderRelativePosition);
}
AZ::Transform GetColliderLocalTransform(const AZ::EntityComponentIdPair& idPair)
{
AZ::Quaternion colliderRotation = AZ::Quaternion::CreateIdentity();
PhysX::EditorColliderComponentRequestBus::EventResult(colliderRotation, idPair, &PhysX::EditorColliderComponentRequests::GetColliderRotation);
AZ::Vector3 colliderOffset = AZ::Vector3::CreateZero();
PhysX::EditorColliderComponentRequestBus::EventResult(colliderOffset, idPair, &PhysX::EditorColliderComponentRequests::GetColliderOffset);
return AZ::Transform::CreateFromQuaternionAndTranslation(colliderRotation, colliderOffset);
}
AZ::Transform GetColliderWorldTransform(const AZ::Transform& worldTransform,
const AZ::Vector3& colliderRelativePosition,
const AZ::Quaternion& colliderRelativeRotation)