diff --git a/panda/src/bullet/bulletContactResult.I b/panda/src/bullet/bulletContactResult.I index 9299631374..ff953db754 100644 --- a/panda/src/bullet/bulletContactResult.I +++ b/panda/src/bullet/bulletContactResult.I @@ -32,7 +32,7 @@ get_node1() const { /** * */ -INLINE BulletManifoldPoint &BulletContact:: +INLINE BulletManifoldPoint BulletContact:: get_manifold_point() { return _mp; diff --git a/panda/src/bullet/bulletContactResult.cxx b/panda/src/bullet/bulletContactResult.cxx index ad4e5b8801..93ceec836d 100644 --- a/panda/src/bullet/bulletContactResult.cxx +++ b/panda/src/bullet/bulletContactResult.cxx @@ -21,9 +21,13 @@ BulletContact BulletContactResult::_empty; */ BulletContact:: BulletContact() : _mp(_empty) { +} - _node0 = nullptr; - _node1 = nullptr; +/** + * + */ +BulletContact:: +BulletContact(btManifoldPoint &mp) : _mp(mp) { } /** @@ -93,9 +97,7 @@ addSingleResult(btManifoldPoint &mp, const btCollisionObject *obj0 = wrap0->getCollisionObject(); const btCollisionObject *obj1 = wrap1->getCollisionObject(); - BulletContact contact; - - contact._mp = BulletManifoldPoint(mp); + BulletContact contact(mp); contact._node0 = obj0 ? (PandaNode *)obj0->getUserPointer() : nullptr; contact._node1 = obj1 ? (PandaNode *)obj1->getUserPointer() : nullptr; contact._part_id0 = part_id0; @@ -116,9 +118,7 @@ addSingleResult(btManifoldPoint &mp, const btCollisionObject *obj0, int part_id0, int idx0, const btCollisionObject *obj1, int part_id1, int idx1) { - BulletContact contact; - - contact._mp = BulletManifoldPoint(mp); + BulletContact contact(mp); contact._node0 = obj0 ? (PandaNode *)obj0->getUserPointer() : nullptr; contact._node1 = obj1 ? (PandaNode *)obj1->getUserPointer() : nullptr; contact._part_id0 = part_id0; diff --git a/panda/src/bullet/bulletContactResult.h b/panda/src/bullet/bulletContactResult.h index 5a881455b0..1c8014466b 100644 --- a/panda/src/bullet/bulletContactResult.h +++ b/panda/src/bullet/bulletContactResult.h @@ -28,10 +28,11 @@ struct EXPCL_PANDABULLET BulletContact { public: BulletContact(); + BulletContact(btManifoldPoint &mp); BulletContact(const BulletContact &other); PUBLISHED: - INLINE BulletManifoldPoint &get_manifold_point(); + INLINE BulletManifoldPoint get_manifold_point(); INLINE PandaNode *get_node0() const; INLINE PandaNode *get_node1() const; INLINE int get_idx0() const; diff --git a/panda/src/bullet/bulletManifoldPoint.I b/panda/src/bullet/bulletManifoldPoint.I index 4347bad4f4..7f016c2839 100644 --- a/panda/src/bullet/bulletManifoldPoint.I +++ b/panda/src/bullet/bulletManifoldPoint.I @@ -10,11 +10,3 @@ * @author enn0x * @date 2010-03-07 */ - -/** - * - */ -INLINE BulletManifoldPoint:: -~BulletManifoldPoint() { - -} diff --git a/panda/src/bullet/bulletManifoldPoint.cxx b/panda/src/bullet/bulletManifoldPoint.cxx index c32a437ac2..85df33e797 100644 --- a/panda/src/bullet/bulletManifoldPoint.cxx +++ b/panda/src/bullet/bulletManifoldPoint.cxx @@ -24,25 +24,6 @@ BulletManifoldPoint(btManifoldPoint &pt) } -/** - * - */ -BulletManifoldPoint:: -BulletManifoldPoint(const BulletManifoldPoint &other) - : _pt(other._pt) { - -} - -/** - * - */ -BulletManifoldPoint& BulletManifoldPoint:: -operator=(const BulletManifoldPoint& other) { - - this->_pt = other._pt; - return *this; -} - /** * */ diff --git a/panda/src/bullet/bulletManifoldPoint.h b/panda/src/bullet/bulletManifoldPoint.h index 633c187d88..b0cb1ce879 100644 --- a/panda/src/bullet/bulletManifoldPoint.h +++ b/panda/src/bullet/bulletManifoldPoint.h @@ -27,7 +27,7 @@ class EXPCL_PANDABULLET BulletManifoldPoint { PUBLISHED: - INLINE ~BulletManifoldPoint(); + ~BulletManifoldPoint() = default; int get_life_time() const; PN_stdfloat get_distance() const; @@ -95,8 +95,8 @@ PUBLISHED: public: BulletManifoldPoint(btManifoldPoint &pt); - BulletManifoldPoint(const BulletManifoldPoint &other); - BulletManifoldPoint& operator=(const BulletManifoldPoint& other); + BulletManifoldPoint(const BulletManifoldPoint &other) = default; + BulletManifoldPoint& operator=(const BulletManifoldPoint& other) = delete; private: btManifoldPoint &_pt;