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
@@ -11,6 +11,7 @@
*/
#include <Scene/PhysXSceneInterface.h>
#include <AzFramework/Physics/Common/PhysicsJoint.h>
#include <AzFramework/Physics/Common/PhysicsSimulatedBody.h>
#include <AzFramework/Physics/Configuration/SceneConfiguration.h>
#include <System/PhysXSystem.h>
@@ -144,6 +145,36 @@ namespace PhysX
}
}
AzPhysics::JointHandle PhysXSceneInterface::AddJoint(
AzPhysics::SceneHandle sceneHandle, const AzPhysics::JointConfiguration* jointConfig,
AzPhysics::SimulatedBodyHandle parentBody, AzPhysics::SimulatedBodyHandle childBody)
{
if (AzPhysics::Scene* scene = m_physxSystem->GetScene(sceneHandle))
{
return scene->AddJoint(jointConfig, parentBody, childBody);
}
return AzPhysics::InvalidJointHandle;
}
AzPhysics::Joint* PhysXSceneInterface::GetJointFromHandle(AzPhysics::SceneHandle sceneHandle, AzPhysics::JointHandle jointHandle)
{
if (AzPhysics::Scene* scene = m_physxSystem->GetScene(sceneHandle))
{
return scene->GetJointFromHandle(jointHandle);
}
return nullptr;
}
void PhysXSceneInterface::RemoveJoint(AzPhysics::SceneHandle sceneHandle, AzPhysics::JointHandle jointHandle)
{
if (AzPhysics::Scene* scene = m_physxSystem->GetScene(sceneHandle))
{
scene->RemoveJoint(jointHandle);
}
}
AzPhysics::SceneQueryHits PhysXSceneInterface::QueryScene(
AzPhysics::SceneHandle sceneHandle, const AzPhysics::SceneQueryRequest* request)
{