Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--[BE] - Remove superfluous RigidBaseManager #2522

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/esp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 1 addition & 21 deletions src/esp/bindings/PhysicsWrapperManagerBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -21,7 +20,6 @@ using PhysWraps::ManagedBulletArticulatedObject;
using PhysWraps::ManagedBulletRigidObject;
using PhysWraps::ManagedRigidObject;
using PhysWraps::PhysicsObjectBaseManager;
using PhysWraps::RigidBaseManager;
using PhysWraps::RigidObjectManager;

namespace esp {
Expand Down Expand Up @@ -189,37 +187,19 @@ void declareBaseWrapperManager(py::module& m,
"search_str"_a = "", "contains"_a = true);
} // declareBaseWrapperManager

template <typename T>
void declareRigidBaseWrapperManager(py::module& m,
CORRADE_UNUSED const std::string& objType,
const std::string& classStrPrefix) {
using MgrClass = RigidBaseManager<T>;
std::string pyclass_name =
classStrPrefix + std::string("_RigidBaseWrapperManager");

py::class_<MgrClass, PhysicsObjectBaseManager<T>, std::shared_ptr<MgrClass>>(
m, pyclass_name.c_str());

} //

void initPhysicsWrapperManagerBindings(pybind11::module& m) {
#ifdef ESP_BUILD_WITH_BULLET
declareBaseWrapperManager<ManagedRigidObject, ManagedBulletRigidObject>(
m, "BulletRigidObject", "BulletRigidObject");

declareRigidBaseWrapperManager<ManagedRigidObject>(m, "BulletRigidObject",
"BulletRigidObject");

#else
// if dynamics library not being used, just use base rigid object
declareBaseWrapperManager<ManagedRigidObject, ManagedRigidObject>(
m, "RigidObject", "RigidObject");

declareRigidBaseWrapperManager<ManagedRigidObject>(m, "RigidObject",
"RigidObject");
#endif
// RigidObject wrapper manager
py::class_<RigidObjectManager, RigidBaseManager<ManagedRigidObject>,
py::class_<RigidObjectManager, PhysicsObjectBaseManager<ManagedRigidObject>,
std::shared_ptr<RigidObjectManager>>(m, "RigidObjectManager")
.def(
"add_object_by_template_id",
Expand Down
36 changes: 0 additions & 36 deletions src/esp/physics/objectManagers/RigidBaseManager.h

This file was deleted.

4 changes: 2 additions & 2 deletions src/esp/physics/objectManagers/RigidObjectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace esp {
namespace physics {

RigidObjectManager::RigidObjectManager()
: esp::physics::RigidBaseManager<ManagedRigidObject>::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"] =
Expand Down
4 changes: 2 additions & 2 deletions src/esp/physics/objectManagers/RigidObjectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -16,7 +16,7 @@ namespace physics {
* managing all @ref esp::physics::ManagedRigidObject wrappers.
*/
class RigidObjectManager
: public esp::physics::RigidBaseManager<ManagedRigidObject> {
: public esp::physics::PhysicsObjectBaseManager<ManagedRigidObject> {
public:
RigidObjectManager();

Expand Down
Loading