Physics joints updated to the new API (#1361)

Co-authored-by: Ulugbek Adilbekov <ulugbek@amazon.com>
This commit is contained in:
amzn-sean
2021-06-17 15:52:27 +01:00
committed by GitHub
parent c46a17f3a6
commit 9f62d631fb
90 changed files with 2792 additions and 1665 deletions
@@ -20,7 +20,6 @@
#include <Source/Utils.h>
#include <Source/Collision.h>
#include <Source/Shape.h>
#include <Source/Joint.h>
#include <Source/Pipeline/MeshAssetHandler.h>
#include <Source/Pipeline/HeightFieldAssetHandler.h>
#include <Source/PhysXCharacters/API/CharacterUtils.h>
@@ -93,7 +92,6 @@ namespace PhysX
void SystemComponent::Reflect(AZ::ReflectContext* context)
{
D6JointLimitConfiguration::Reflect(context);
Pipeline::MeshAsset::Reflect(context);
PhysX::ReflectionUtils::ReflectPhysXOnlyApi(context);
@@ -347,49 +345,6 @@ namespace PhysX
return AZStd::make_shared<PhysX::Material>(materialConfiguration);
}
AZStd::vector<AZ::TypeId> SystemComponent::GetSupportedJointTypes()
{
return JointUtils::GetSupportedJointTypes();
}
AZStd::shared_ptr<Physics::JointLimitConfiguration> SystemComponent::CreateJointLimitConfiguration(AZ::TypeId jointType)
{
return JointUtils::CreateJointLimitConfiguration(jointType);
}
AZStd::shared_ptr<Physics::Joint> SystemComponent::CreateJoint(const AZStd::shared_ptr<Physics::JointLimitConfiguration>& configuration,
AzPhysics::SimulatedBody* parentBody, AzPhysics::SimulatedBody* childBody)
{
return JointUtils::CreateJoint(configuration, parentBody, childBody);
}
void SystemComponent::GenerateJointLimitVisualizationData(
const Physics::JointLimitConfiguration& configuration,
const AZ::Quaternion& parentRotation,
const AZ::Quaternion& childRotation,
float scale,
AZ::u32 angularSubdivisions,
AZ::u32 radialSubdivisions,
AZStd::vector<AZ::Vector3>& vertexBufferOut,
AZStd::vector<AZ::u32>& indexBufferOut,
AZStd::vector<AZ::Vector3>& lineBufferOut,
AZStd::vector<bool>& lineValidityBufferOut)
{
JointUtils::GenerateJointLimitVisualizationData(configuration, parentRotation, childRotation, scale,
angularSubdivisions, radialSubdivisions, vertexBufferOut, indexBufferOut, lineBufferOut, lineValidityBufferOut);
}
AZStd::unique_ptr<Physics::JointLimitConfiguration> SystemComponent::ComputeInitialJointLimitConfiguration(
const AZ::TypeId& jointLimitTypeId,
const AZ::Quaternion& parentWorldRotation,
const AZ::Quaternion& childWorldRotation,
const AZ::Vector3& axis,
const AZStd::vector<AZ::Quaternion>& exampleLocalRotations)
{
return JointUtils::ComputeInitialJointLimitConfiguration(jointLimitTypeId, parentWorldRotation,
childWorldRotation, axis, exampleLocalRotations);
}
void SystemComponent::ReleaseNativeMeshObject(void* nativeMeshObject)
{
if (nativeMeshObject)