From cf681eb8dd2e8dfbb84b7978d3ac453f1df175d0 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 2 Nov 2021 15:34:13 +0100 Subject: [PATCH] bullet: Clean up fix for #1193 See ad7cbcd4ec447d4423e05b0e0b813327bd722bf3 --- panda/src/bullet/bulletPersistentManifold.cxx | 14 +------------- panda/src/bullet/bulletPersistentManifold.h | 7 +++---- panda/src/bullet/bulletWorld.cxx | 15 +-------------- panda/src/bullet/bulletWorld.h | 7 +++---- 4 files changed, 8 insertions(+), 35 deletions(-) diff --git a/panda/src/bullet/bulletPersistentManifold.cxx b/panda/src/bullet/bulletPersistentManifold.cxx index f5e96d0464..ba1ca9a2e3 100644 --- a/panda/src/bullet/bulletPersistentManifold.cxx +++ b/panda/src/bullet/bulletPersistentManifold.cxx @@ -104,23 +104,11 @@ get_num_manifold_points() const { return _manifold->getNumContacts(); } -/** - * - */ -BulletManifoldPoint *BulletPersistentManifold:: -get_manifold_point(int idx) const { - LightMutexHolder holder(BulletWorld::get_global_lock()); - - nassertr(idx < _manifold->getNumContacts(), nullptr) - - return new BulletManifoldPoint(_manifold->getContactPoint(idx)); -} - /** * */ BulletManifoldPoint BulletPersistentManifold:: -__get_manifold_point(int idx) const { +get_manifold_point(int idx) const { LightMutexHolder holder(BulletWorld::get_global_lock()); return BulletManifoldPoint(_manifold->getContactPoint(idx)); } diff --git a/panda/src/bullet/bulletPersistentManifold.h b/panda/src/bullet/bulletPersistentManifold.h index 06e9b47564..13954ede0c 100644 --- a/panda/src/bullet/bulletPersistentManifold.h +++ b/panda/src/bullet/bulletPersistentManifold.h @@ -34,9 +34,8 @@ PUBLISHED: PandaNode *get_node1(); int get_num_manifold_points() const; - BulletManifoldPoint *get_manifold_point(int idx) const; - BulletManifoldPoint __get_manifold_point(int idx) const; - MAKE_SEQ(get_manifold_points, get_num_manifold_points, __get_manifold_point); + BulletManifoldPoint get_manifold_point(int idx) const; + MAKE_SEQ(get_manifold_points, get_num_manifold_points, get_manifold_point); PN_stdfloat get_contact_breaking_threshold() const; PN_stdfloat get_contact_processing_threshold() const; @@ -45,7 +44,7 @@ PUBLISHED: MAKE_PROPERTY(node0, get_node0); MAKE_PROPERTY(node1, get_node1); - MAKE_SEQ_PROPERTY(manifold_points, get_num_manifold_points, __get_manifold_point); + MAKE_SEQ_PROPERTY(manifold_points, get_num_manifold_points, get_manifold_point); MAKE_PROPERTY(contact_breaking_threshold, get_contact_breaking_threshold); MAKE_PROPERTY(contact_processing_threshold, get_contact_processing_threshold); diff --git a/panda/src/bullet/bulletWorld.cxx b/panda/src/bullet/bulletWorld.cxx index 4874f86db3..8a4bbfb0d3 100644 --- a/panda/src/bullet/bulletWorld.cxx +++ b/panda/src/bullet/bulletWorld.cxx @@ -1061,24 +1061,11 @@ contact_test_pair(PandaNode *node0, PandaNode *node1) const { return cb; } -/** - * - */ -BulletPersistentManifold *BulletWorld:: -get_manifold(int idx) const { - LightMutexHolder holder(get_global_lock()); - - nassertr(idx < _dispatcher->getNumManifolds(), nullptr); - - btPersistentManifold *ptr = _dispatcher->getManifoldByIndexInternal(idx); - return (ptr) ? new BulletPersistentManifold(ptr) : nullptr; -} - /** * */ BulletPersistentManifold BulletWorld:: -__get_manifold(int idx) const { +get_manifold(int idx) const { LightMutexHolder holder(get_global_lock()); nassertr(idx < _dispatcher->getNumManifolds(), BulletPersistentManifold(nullptr)); diff --git a/panda/src/bullet/bulletWorld.h b/panda/src/bullet/bulletWorld.h index 669c8944d3..83c0ac634c 100644 --- a/panda/src/bullet/bulletWorld.h +++ b/panda/src/bullet/bulletWorld.h @@ -127,9 +127,8 @@ PUBLISHED: // Manifolds int get_num_manifolds() const; - BulletPersistentManifold *get_manifold(int idx) const; - BulletPersistentManifold __get_manifold(int idx) const; - MAKE_SEQ(get_manifolds, get_num_manifolds, __get_manifold); + BulletPersistentManifold get_manifold(int idx) const; + MAKE_SEQ(get_manifolds, get_num_manifolds, get_manifold); // Collision filtering void set_group_collision_flag(unsigned int group1, unsigned int group2, bool enable); @@ -169,7 +168,7 @@ PUBLISHED: MAKE_SEQ_PROPERTY(characters, get_num_characters, get_character); MAKE_SEQ_PROPERTY(vehicles, get_num_vehicles, get_vehicle); MAKE_SEQ_PROPERTY(constraints, get_num_constraints, get_constraint); - MAKE_SEQ_PROPERTY(manifolds, get_num_manifolds, __get_manifold); + MAKE_SEQ_PROPERTY(manifolds, get_num_manifolds, get_manifold); MAKE_PROPERTY(force_update_all_aabbs, get_force_update_all_aabbs, set_force_update_all_aabbs);