From 8c3cf3bdddac7fb9b8fa91a4a694d30ecfd44f1b Mon Sep 17 00:00:00 2001 From: Fanbo Xiang Date: Tue, 7 Nov 2023 21:03:36 -0800 Subject: [PATCH] fix articulation destruction --- 3rd_party/sapien-vulkan-2 | 2 +- include/sapien/component/physx/articulation.h | 2 ++ python/py_package/__init__.pyi | 2 +- src/component/physx/articulation.cpp | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/3rd_party/sapien-vulkan-2 b/3rd_party/sapien-vulkan-2 index 5b1203ab..a9a39f87 160000 --- a/3rd_party/sapien-vulkan-2 +++ b/3rd_party/sapien-vulkan-2 @@ -1 +1 @@ -Subproject commit 5b1203abf28d59fbe1e29fb7544dc0c8337edf77 +Subproject commit a9a39f87e6e44e07193ecd8cfd7b9102c840c90b diff --git a/include/sapien/component/physx/articulation.h b/include/sapien/component/physx/articulation.h index 6b3fd96a..91b34766 100644 --- a/include/sapien/component/physx/articulation.h +++ b/include/sapien/component/physx/articulation.h @@ -95,6 +95,8 @@ class PhysxArticulation { mLinks.resize(size, 0); } + std::shared_ptr mEngine; + physx::PxArticulationReducedCoordinate *mPxArticulation{}; physx::PxArticulationCache *mCache{}; diff --git a/python/py_package/__init__.pyi b/python/py_package/__init__.pyi index 0dc283de..3af5e6df 100644 --- a/python/py_package/__init__.pyi +++ b/python/py_package/__init__.pyi @@ -61,5 +61,5 @@ __all__ = [ def set_log_level(level: str) -> None: pass -__version__ = '3.0.0.dev20231107' +__version__ = '3.0.0.dev20231108' SceneConfig = sapien.pysapien.physx.PhysxSceneConfig diff --git a/src/component/physx/articulation.cpp b/src/component/physx/articulation.cpp index d501aa22..81fc122d 100644 --- a/src/component/physx/articulation.cpp +++ b/src/component/physx/articulation.cpp @@ -14,6 +14,7 @@ shared_link(PhysxArticulationLinkComponent *link) { } PhysxArticulation::PhysxArticulation() { + mEngine = PhysxEngine::Get(); mPxArticulation = PhysxEngine::Get()->getPxPhysics()->createArticulationReducedCoordinate(); mPxArticulation->setArticulationFlag(PxArticulationFlag::eDRIVE_LIMITS_ARE_FORCES, true); }