From c7e46f61b0dec8b9e3157b4a09f999367015b5c7 Mon Sep 17 00:00:00 2001 From: John Turner <7strbass@gmail.com> Date: Thu, 19 Dec 2024 09:03:10 -0500 Subject: [PATCH] --remove superfluous RIgidBaseManager --- src/esp/CMakeLists.txt | 1 - .../PhysicsWrapperManagerBindings.cpp | 22 +----------- .../physics/objectManagers/RigidBaseManager.h | 36 ------------------- .../objectManagers/RigidObjectManager.cpp | 4 +-- .../objectManagers/RigidObjectManager.h | 4 +-- 5 files changed, 5 insertions(+), 62 deletions(-) delete mode 100644 src/esp/physics/objectManagers/RigidBaseManager.h diff --git a/src/esp/CMakeLists.txt b/src/esp/CMakeLists.txt index a4639d000c..b878364cfd 100644 --- a/src/esp/CMakeLists.txt +++ b/src/esp/CMakeLists.txt @@ -393,7 +393,6 @@ set( physics/objectManagers/ArticulatedObjectManager.cpp physics/objectManagers/ArticulatedObjectManager.h physics/objectManagers/PhysicsObjectBaseManager.h - physics/objectManagers/RigidBaseManager.h physics/objectManagers/RigidObjectManager.cpp physics/objectManagers/RigidObjectManager.h physics/objectWrappers/ManagedArticulatedObject.h diff --git a/src/esp/bindings/PhysicsWrapperManagerBindings.cpp b/src/esp/bindings/PhysicsWrapperManagerBindings.cpp index 6f0b4dcc5c..50d42ff6c0 100644 --- a/src/esp/bindings/PhysicsWrapperManagerBindings.cpp +++ b/src/esp/bindings/PhysicsWrapperManagerBindings.cpp @@ -8,7 +8,6 @@ #include "esp/physics/bullet/objectWrappers/ManagedBulletRigidObject.h" #include "esp/physics/objectManagers/ArticulatedObjectManager.h" #include "esp/physics/objectManagers/PhysicsObjectBaseManager.h" -#include "esp/physics/objectManagers/RigidBaseManager.h" #include "esp/physics/objectManagers/RigidObjectManager.h" #include "esp/physics/objectWrappers/ManagedRigidObject.h" @@ -21,7 +20,6 @@ using PhysWraps::ManagedBulletArticulatedObject; using PhysWraps::ManagedBulletRigidObject; using PhysWraps::ManagedRigidObject; using PhysWraps::PhysicsObjectBaseManager; -using PhysWraps::RigidBaseManager; using PhysWraps::RigidObjectManager; namespace esp { @@ -189,37 +187,19 @@ void declareBaseWrapperManager(py::module& m, "search_str"_a = "", "contains"_a = true); } // declareBaseWrapperManager -template -void declareRigidBaseWrapperManager(py::module& m, - CORRADE_UNUSED const std::string& objType, - const std::string& classStrPrefix) { - using MgrClass = RigidBaseManager; - std::string pyclass_name = - classStrPrefix + std::string("_RigidBaseWrapperManager"); - - py::class_, std::shared_ptr>( - m, pyclass_name.c_str()); - -} // - void initPhysicsWrapperManagerBindings(pybind11::module& m) { #ifdef ESP_BUILD_WITH_BULLET declareBaseWrapperManager( m, "BulletRigidObject", "BulletRigidObject"); - declareRigidBaseWrapperManager(m, "BulletRigidObject", - "BulletRigidObject"); - #else // if dynamics library not being used, just use base rigid object declareBaseWrapperManager( m, "RigidObject", "RigidObject"); - declareRigidBaseWrapperManager(m, "RigidObject", - "RigidObject"); #endif // RigidObject wrapper manager - py::class_, + py::class_, std::shared_ptr>(m, "RigidObjectManager") .def( "add_object_by_template_id", diff --git a/src/esp/physics/objectManagers/RigidBaseManager.h b/src/esp/physics/objectManagers/RigidBaseManager.h deleted file mode 100644 index dec766d480..0000000000 --- a/src/esp/physics/objectManagers/RigidBaseManager.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Meta Platforms, Inc. and its affiliates. -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. - -#ifndef ESP_PHYSICS_RIGIDBASEMANAGER_H -#define ESP_PHYSICS_RIGIDBASEMANAGER_H - -#include "PhysicsObjectBaseManager.h" - -namespace esp { -namespace physics { - -/** - * @brief Class template defining responsibilities and functionality shared for - * managing all @ref esp::physics::AbstractManagedRigidBase wrappers. - * @tparam T the type of managed physics object a particular specialization - * of this class works with. Must inherit from @ref - * esp::physics::AbstractManagedRigidBase - */ - -template -class RigidBaseManager : public esp::physics::PhysicsObjectBaseManager { - public: - explicit RigidBaseManager(const std::string& objType) - : esp::physics::PhysicsObjectBaseManager::PhysicsObjectBaseManager( - objType) {} - - protected: - public: - ESP_SMART_POINTERS(RigidBaseManager) -}; // class RigidBaseManage - -} // namespace physics -} // namespace esp - -#endif // ESP_PHYSICS_RIGIDBASEMANAGER_H diff --git a/src/esp/physics/objectManagers/RigidObjectManager.cpp b/src/esp/physics/objectManagers/RigidObjectManager.cpp index b106e4fd7e..47c214d9b8 100644 --- a/src/esp/physics/objectManagers/RigidObjectManager.cpp +++ b/src/esp/physics/objectManagers/RigidObjectManager.cpp @@ -7,8 +7,8 @@ namespace esp { namespace physics { RigidObjectManager::RigidObjectManager() - : esp::physics::RigidBaseManager::RigidBaseManager( - "RigidObject") { + : esp::physics::PhysicsObjectBaseManager< + ManagedRigidObject>::PhysicsObjectBaseManager("RigidObject") { // build this manager's copy constructor map, keyed by the type name of the // wrappers it will manage this->copyConstructorMap_["ManagedRigidObject"] = diff --git a/src/esp/physics/objectManagers/RigidObjectManager.h b/src/esp/physics/objectManagers/RigidObjectManager.h index 1355eb2777..36ca66d6ce 100644 --- a/src/esp/physics/objectManagers/RigidObjectManager.h +++ b/src/esp/physics/objectManagers/RigidObjectManager.h @@ -5,7 +5,7 @@ #ifndef ESP_PHYSICS_RIGIDOBJECTMANAGER_H #define ESP_PHYSICS_RIGIDOBJECTMANAGER_H -#include "RigidBaseManager.h" +#include "PhysicsObjectBaseManager.h" #include "esp/physics/bullet/objectWrappers/ManagedBulletRigidObject.h" #include "esp/physics/objectWrappers/ManagedRigidObject.h" namespace esp { @@ -16,7 +16,7 @@ namespace physics { * managing all @ref esp::physics::ManagedRigidObject wrappers. */ class RigidObjectManager - : public esp::physics::RigidBaseManager { + : public esp::physics::PhysicsObjectBaseManager { public: RigidObjectManager();