Physics joints updated to the new API (#1361)
Co-authored-by: Ulugbek Adilbekov <ulugbek@amazon.com>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user