bullet: Clean up fix for #1193

See ad7cbcd4ec447d4423e05b0e0b813327bd722bf3
This commit is contained in:
rdb 2021-11-02 15:34:13 +01:00
parent 0bc0709b72
commit cf681eb8dd
4 changed files with 8 additions and 35 deletions

View File

@ -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));
}

View File

@ -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);

View File

@ -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));

View File

@ -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);