Bullet: added tick callback, and filter callback now uses CallbackObject.

This commit is contained in:
enn0x 2012-11-26 22:49:36 +00:00
parent 8d66921d79
commit 70cea909c5
15 changed files with 455 additions and 142 deletions

View File

@ -28,6 +28,7 @@
bulletConvexPointCloudShape.h bulletConvexPointCloudShape.I \
bulletCylinderShape.h bulletCylinderShape.I \
bulletDebugNode.h bulletDebugNode.I \
bulletFilterCallbackData.h bulletFilterCallbackData.I \
bulletGenericConstraint.h bulletGenericConstraint.I \
bulletGhostNode.h bulletGhostNode.I \
bulletHeightfieldShape.h bulletHeightfieldShape.I \
@ -47,6 +48,7 @@
bulletSoftBodyWorldInfo.h bulletSoftBodyWorldInfo.I \
bulletSphereShape.h bulletSphereShape.I \
bulletSphericalConstraint.h bulletSphericalConstraint.I \
bulletTickCallbackData.h bulletTickCallbackData.I \
bulletTriangleMesh.h bulletTriangleMesh.I \
bulletTriangleMeshShape.h bulletTriangleMeshShape.I \
bulletVehicle.h bulletVehicle.I \
@ -74,6 +76,7 @@
bulletConvexPointCloudShape.cxx \
bulletCylinderShape.cxx \
bulletDebugNode.cxx \
bulletFilterCallbackData.cxx \
bulletGenericConstraint.cxx \
bulletGhostNode.cxx \
bulletHeightfieldShape.cxx \
@ -93,6 +96,7 @@
bulletSoftBodyWorldInfo.cxx \
bulletSphereShape.cxx \
bulletSphericalConstraint.cxx \
bulletTickCallbackData.cxx \
bulletTriangleMesh.cxx \
bulletTriangleMeshShape.cxx \
bulletVehicle.cxx \
@ -120,6 +124,7 @@
bulletConvexPointCloudShape.h bulletConvexPointCloudShape.I \
bulletCylinderShape.h bulletCylinderShape.I \
bulletDebugNode.h bulletDebugNode.I \
bulletFilterCallbackData.h bulletFilterCallbackData.I \
bulletGenericConstraint.h bulletGenericConstraint.I \
bulletGhostNode.h bulletGhostNode.I \
bulletHeightfieldShape.h bulletHeightfieldShape.I \
@ -139,6 +144,7 @@
bulletSoftBodyWorldInfo.h bulletSoftBodyWorldInfo.I \
bulletSphereShape.h bulletSphereShape.I \
bulletSphericalConstraint.h bulletSphericalConstraint.I \
bulletTickCallbackData.h bulletTickCallbackData.I \
bulletTriangleMesh.h bulletTriangleMesh.I \
bulletTriangleMeshShape.h bulletTriangleMeshShape.I \
bulletVehicle.h bulletVehicle.I \

View File

@ -18,35 +18,17 @@
// Description:
////////////////////////////////////////////////////////////////////
INLINE BulletContactCallbackData::
BulletContactCallbackData(BulletManifoldPoint &mp, PandaNode *node0, PandaNode *node1) :
BulletContactCallbackData(BulletManifoldPoint &mp, PandaNode *node0, PandaNode *node1, int id0, int id1, int index0, int index1) :
_mp(mp),
_node0(node0),
_node1(node1),
_mp(mp) {
_id0(id0),
_id1(id1),
_index0(index0),
_index1(index1) {
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_node_0
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE PandaNode *BulletContactCallbackData::
get_node_0() const {
return _node0;
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_node_1
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE PandaNode *BulletContactCallbackData::
get_node_1() const {
return _node1;
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_manifold
// Access: Published
@ -58,3 +40,69 @@ get_manifold() const {
return _mp;
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_node0
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE PandaNode *BulletContactCallbackData::
get_node0() const {
return _node0;
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_node1
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE PandaNode *BulletContactCallbackData::
get_node1() const {
return _node1;
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_part_id0
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE int BulletContactCallbackData::
get_part_id0() const {
return _id0;
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_part_id1
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE int BulletContactCallbackData::
get_part_id1() const {
return _id1;
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_index0
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE int BulletContactCallbackData::
get_index0() const {
return _index0;
}
////////////////////////////////////////////////////////////////////
// Function: BulletContactCallbackData::get_index1
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE int BulletContactCallbackData::
get_index1() const {
return _index1;
}

View File

@ -31,17 +31,26 @@ class EXPCL_PANDABULLET BulletContactCallbackData : public CallbackData {
PUBLISHED:
INLINE BulletContactCallbackData(BulletManifoldPoint &mp,
PandaNode *node0,
PandaNode *node1);
PandaNode *node0, PandaNode *node1,
int id0, int id1,
int index0, int index1);
PandaNode *get_node_0() const;
PandaNode *get_node_1() const;
BulletManifoldPoint &get_manifold() const;
INLINE BulletManifoldPoint &get_manifold() const;
INLINE PandaNode *get_node0() const;
INLINE PandaNode *get_node1() const;
INLINE int get_part_id0() const;
INLINE int get_part_id1() const;
INLINE int get_index0() const;
INLINE int get_index1() const;
private:
BulletManifoldPoint &_mp;
PandaNode *_node0;
PandaNode *_node1;
BulletManifoldPoint &_mp;
int _id0;
int _id1;
int _index0;
int _index1;
////////////////////////////////////////////////////////////////////
public:

View File

@ -73,7 +73,7 @@ contact_added_callback(btManifoldPoint &cp,
if (bullet_contact_added_callback) {
BulletManifoldPoint mp(cp);
BulletContactCallbackData cbdata(mp, node0, node1);
BulletContactCallbackData cbdata(mp, node0, node1, id0, id1, index0, index1);
bullet_contact_added_callback->do_callback(&cbdata);
}

View File

@ -0,0 +1,71 @@
// Filename: bulletFilterCallbackData.I
// Created by: enn0x (26Nov12)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: BulletFilterCallbackData::Constructor
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE BulletFilterCallbackData::
BulletFilterCallbackData(PandaNode *node0, PandaNode *node1) :
_node0(node0),
_node1(node1),
_collide(false) {
}
////////////////////////////////////////////////////////////////////
// Function: BulletFilterCallbackData::get_node_0
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE PandaNode *BulletFilterCallbackData::
get_node_0() const {
return _node0;
}
////////////////////////////////////////////////////////////////////
// Function: BulletFilterCallbackData::get_node_1
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE PandaNode *BulletFilterCallbackData::
get_node_1() const {
return _node1;
}
////////////////////////////////////////////////////////////////////
// Function: BulletFilterCallbackData::get_collide
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE bool BulletFilterCallbackData::
get_collide() const {
return _collide;
}
////////////////////////////////////////////////////////////////////
// Function: BulletFilterCallbackData::set_collide
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE void BulletFilterCallbackData::
set_collide(bool collide) {
_collide = collide;
}

View File

@ -0,0 +1,18 @@
// Filename: bulletFilterCallbackData.cxx
// Created by: enn0x (26Nov12)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#include "bulletFilterCallbackData.h"
TypeHandle BulletFilterCallbackData::_type_handle;

View File

@ -0,0 +1,70 @@
// Filename: bulletFilterCallbackData.h
// Created by: enn0x (26Nov12)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef __BULLET_FILTER_CALLBACK_DATA_H__
#define __BULLET_FILTER_CALLBACK_DATA_H__
#include "pandabase.h"
#include "callbackData.h"
#include "callbackObject.h"
#include "bullet_includes.h"
#include "bullet_utils.h"
////////////////////////////////////////////////////////////////////
// Class : BulletFilterCallbackData
// Description :
////////////////////////////////////////////////////////////////////
class EXPCL_PANDABULLET BulletFilterCallbackData : public CallbackData {
PUBLISHED:
INLINE BulletFilterCallbackData(PandaNode *node0,
PandaNode *node1);
INLINE PandaNode *get_node_0() const;
INLINE PandaNode *get_node_1() const;
INLINE void set_collide(bool collide);
INLINE bool get_collide() const;
private:
PandaNode *_node0;
PandaNode *_node1;
bool _collide;
////////////////////////////////////////////////////////////////////
public:
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
CallbackData::init_type();
register_type(_type_handle, "BulletFilterCallbackData",
CallbackData::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {
init_type();
return get_class_type();
}
private:
static TypeHandle _type_handle;
};
#include "bulletFilterCallbackData.I"
#endif // __BULLET_FILTER_CALLBACK_DATA_H__

View File

@ -0,0 +1,36 @@
// Filename: bulletTickCallbackData.I
// Created by: enn0x (26Nov12)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: BulletTickCallbackData::Constructor
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE BulletTickCallbackData::
BulletTickCallbackData(btScalar timestep) :
_timestep(timestep) {
}
////////////////////////////////////////////////////////////////////
// Function: BulletTickCallbackData::get_timestep
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE PN_stdfloat BulletTickCallbackData::
get_timestep() const {
return (PN_stdfloat)_timestep;
}

View File

@ -0,0 +1,18 @@
// Filename: bulletTickCallbackData.cxx
// Created by: enn0x (26Nov12)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#include "bulletTickCallbackData.h"
TypeHandle BulletTickCallbackData::_type_handle;

View File

@ -0,0 +1,62 @@
// Filename: bulletTickCallbackData.h
// Created by: enn0x (26Nov12)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef __BULLET_TICK_CALLBACK_DATA_H__
#define __BULLET_TICK_CALLBACK_DATA_H__
#include "pandabase.h"
#include "callbackData.h"
#include "callbackObject.h"
#include "bullet_includes.h"
////////////////////////////////////////////////////////////////////
// Class : BulletTickCallbackData
// Description :
////////////////////////////////////////////////////////////////////
class EXPCL_PANDABULLET BulletTickCallbackData : public CallbackData {
PUBLISHED:
INLINE BulletTickCallbackData(btScalar timestep);
INLINE PN_stdfloat get_timestep() const;
private:
btScalar _timestep;
////////////////////////////////////////////////////////////////////
public:
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
CallbackData::init_type();
register_type(_type_handle, "BulletTickCallbackData",
CallbackData::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {
init_type();
return get_class_type();
}
private:
static TypeHandle _type_handle;
};
#include "bulletTickCallbackData.I"
#endif // __BULLET_TICK_CALLBACK_DATA_H__

View File

@ -52,10 +52,6 @@ INLINE BulletWorld::
delete _configuration;
delete _dispatcher;
delete _broadphase;
#ifdef HAVE_PYTHON
Py_XDECREF(_filter_cb3._python_callback);
#endif
}
////////////////////////////////////////////////////////////////////

View File

@ -19,14 +19,6 @@
#include "collideMask.h"
#ifdef HAVE_PYTHON
#include "py_panda.h"
#include "typedReferenceCount.h"
#ifndef CPPPARSER
extern EXPCL_PANDAODE Dtool_PyTypedObject Dtool_PandaNode;
#endif
#endif
#define clamp(x, x_min, x_max) max(min(x, x_max), x_min)
TypeHandle BulletWorld::_type_handle;
@ -77,29 +69,6 @@ BulletWorld() {
_dispatcher = new btCollisionDispatcher(_configuration);
nassertv(_dispatcher);
/*
_dispatcher.registerCollisionCreateFunc(
BroadphaseNativeType.ConvexTriangleMeshShape,
BroadphaseNativeType.ConvexTriangleMeshShape,
dcc.GetCollisionAlgorithmCreateFunc(
BroadphaseNativeType.TriangleMeshShape,
BroadphaseNativeType.TriangleMeshShape));
_dispatcher.registerCollisionCreateFunc(
BroadphaseNativeType.TriangleMeshShape,
BroadphaseNativeType.TriangleMeshShape,
dcc.GetCollisionAlgorithmCreateFunc(
BroadphaseNativeType.ConvexTriangleMeshShape,
BroadphaseNativeType.ConvexTriangleMeshShape));
_dispatcher.registerCollisionCreateFunc(
BroadphaseNativeType.ConvexTriangleMeshShape,
BroadphaseNativeType.ConvexTriangleMeshShape,
dcc.GetCollisionAlgorithmCreateFunc(
BroadphaseNativeType.ConvexTriangleMeshShape,
BroadphaseNativeType.ConvexTriangleMeshShape));
*/
// Solver
_solver = new btSequentialImpulseConstraintSolver;
nassertv(_solver);
@ -109,6 +78,7 @@ BulletWorld() {
nassertv(_world);
nassertv(_world->getPairCache());
_world->setWorldUserInfo(this);
_world->setGravity(btVector3(0.0f, 0.0f, 0.0f));
// Ghost-pair callback
@ -122,13 +92,16 @@ BulletWorld() {
case FA_groups_mask:
_world->getPairCache()->setOverlapFilterCallback(&_filter_cb2);
break;
case FA_python_callback:
case FA_callback:
_world->getPairCache()->setOverlapFilterCallback(&_filter_cb3);
break;
default:
bullet_cat.error() << "no proper filter algorithm!" << endl;
}
// Tick callback
_tick_callback_obj = NULL;
// SoftBodyWorldInfo
_info.m_dispatcher = _dispatcher;
_info.m_broadphase = _broadphase;
@ -899,30 +872,71 @@ clear_contact_added_callback() {
bullet_contact_added_callback = NULL;
}
#ifdef HAVE_PYTHON
////////////////////////////////////////////////////////////////////
// Function: BulletWorld::set_python_filter_callback
// Function: BulletWorld::set_tick_callback
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
void BulletWorld::
set_python_filter_callback(PyObject *callback) {
set_tick_callback(CallbackObject *obj) {
nassertv(callback != NULL);
if (!PyCallable_Check(callback)) {
PyErr_Format(PyExc_TypeError, "'%s' object is not callable", callback->ob_type->tp_name);
return;
nassertv(obj != NULL);
_tick_callback_obj = obj;
}
if (bullet_filter_algorithm != FA_python_callback) {
////////////////////////////////////////////////////////////////////
// Function: BulletWorld::clear_tick_callback
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
void BulletWorld::
clear_tick_callback() {
_tick_callback_obj = NULL;
}
///////////////////////////////////////////////////////////////////
// Function: BulletWorld::tick_callback
// Access: Private
// Description:
////////////////////////////////////////////////////////////////////
void BulletWorld::
tick_callback(btDynamicsWorld *world, btScalar timestep) {
nassertv(world->getWorldUserInfo());
BulletWorld *w = static_cast<BulletWorld *>(world->getWorldUserInfo());
BulletTickCallbackData cbdata(timestep);
w->_tick_callback_obj->do_callback(&cbdata);
}
////////////////////////////////////////////////////////////////////
// Function: BulletWorld::set_filter_callback
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
void BulletWorld::
set_filter_callback(CallbackObject *obj) {
nassertv(obj != NULL);
if (bullet_filter_algorithm != FA_callback) {
bullet_cat.warning() << "filter algorithm is not 'python-callback'" << endl;
}
_filter_cb3._python_callback = callback;
Py_XINCREF(_filter_cb3._python_callback);
_filter_cb3._filter_callback_obj = obj;
}
////////////////////////////////////////////////////////////////////
// Function: BulletWorld::clear_filter_callback
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
void BulletWorld::
clear_filter_callback() {
_filter_cb3._filter_callback_obj = NULL;
}
#endif
////////////////////////////////////////////////////////////////////
// Function: BulletWorld::FilterCallback1::needBroadphaseCollision
@ -983,7 +997,6 @@ needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) co
return false;
}
#ifdef HAVE_PYTHON
////////////////////////////////////////////////////////////////////
// Function: BulletWorld::FilterCallback3::needBroadphaseCollision
// Access: Published
@ -992,7 +1005,7 @@ needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) co
bool BulletWorld::btFilterCallback3::
needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) const {
nassertr(_python_callback, false);
nassertr(_filter_callback_obj, false);
btCollisionObject *obj0 = (btCollisionObject *) proxy0->m_clientObject;
btCollisionObject *obj1 = (btCollisionObject *) proxy1->m_clientObject;
@ -1006,37 +1019,10 @@ needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) co
nassertr(node0, false);
nassertr(node1, false);
PyObject *p0 = DTool_CreatePyInstanceTyped(node0, Dtool_PandaNode, true, false, node0->get_type_index());
PyObject *p1 = DTool_CreatePyInstanceTyped(node1, Dtool_PandaNode, true, false, node1->get_type_index());
PyObject *result = PyEval_CallFunction(_python_callback, "OO", p0, p1);
bool collide = false;
if (!result) {
bullet_cat.error() << "An error occurred while calling python function!" << endl;
PyErr_Print();
BulletFilterCallbackData cbdata(node0, node1);
_filter_callback_obj->do_callback(&cbdata);
return cbdata.get_collide();
}
else {
int v = PyObject_IsTrue(result);
if (v == 1) {
collide = true;
}
else if (v == 0) {
collide = false;
}
else {
bullet_cat.error() << "Python callback function must return a bool object" << endl;
}
Py_DECREF(result);
}
//Py_XDECREF(p0);
//Py_XDECREF(p1);
return collide;
}
#endif
////////////////////////////////////////////////////////////////////
// Function: BulletWorld::BroadphaseAlgorithm ostream operator
@ -1090,14 +1076,10 @@ operator << (ostream &out, BulletWorld::FilterAlgorithm algorithm) {
switch (algorithm) {
case BulletWorld::FA_mask:
return out << "mask";
case BulletWorld::FA_groups_mask:
return out << "groups-mask";
#ifdef HAVE_PYTHON
case BulletWorld::FA_python_callback:
return out << "python-callback";
#endif
case BulletWorld::FA_callback:
return out << "callback";
};
return out << "**invalid BulletWorld::FilterAlgorithm(" << (int)algorithm << ")**";
}
@ -1117,17 +1099,14 @@ operator >> (istream &in, BulletWorld::FilterAlgorithm &algorithm) {
else if (word == "groups-mask") {
algorithm = BulletWorld::FA_groups_mask;
}
#ifdef HAVE_PYTHON
else if (word == "python-callback") {
algorithm = BulletWorld::FA_python_callback;
else if (word == "callback") {
algorithm = BulletWorld::FA_callback;
}
#endif
else {
bullet_cat.error()
<< "Invalid BulletWorld::FilterAlgorithm: " << word << "\n";
algorithm = BulletWorld::FA_mask;
}
return in;
}

View File

@ -39,11 +39,6 @@
#include "collideMask.h"
#include "luse.h"
#ifdef HAVE_PYTHON
#include "py_panda.h"
#include "Python.h"
#endif
class BulletPersistentManifold;
class BulletShape;
class BulletSoftBodyWorldInfo;
@ -142,6 +137,12 @@ PUBLISHED:
void set_contact_added_callback(CallbackObject *obj);
void clear_contact_added_callback();
void set_tick_callback(CallbackObject *obj);
void clear_tick_callback();
void set_filter_callback(CallbackObject *obj);
void clear_filter_callback();
// Configuration
enum BroadphaseAlgorithm {
BA_sweep_and_prune,
@ -151,15 +152,9 @@ PUBLISHED:
enum FilterAlgorithm {
FA_mask,
FA_groups_mask,
#ifdef HAVE_PYTHON
FA_python_callback,
#endif
FA_callback,
};
#ifdef HAVE_PYTHON
void set_python_filter_callback(PyObject *callback);
#endif
PUBLISHED: // Deprecated methods, will become private soon
void attach_ghost(BulletGhostNode *node);
void remove_ghost(BulletGhostNode *node);
@ -187,6 +182,8 @@ private:
void sync_p2b(PN_stdfloat dt, int num_substeps);
void sync_b2p();
void tick_callback(btDynamicsWorld *world, btScalar timestep);
typedef PTA(PT(BulletRigidBodyNode)) BulletRigidBodies;
typedef PTA(PT(BulletSoftBodyNode)) BulletSoftBodies;
typedef PTA(PT(BulletGhostNode)) BulletGhosts;
@ -214,15 +211,13 @@ private:
CollideMask _collide[32];
};
#ifdef HAVE_PYTHON
struct btFilterCallback3 : public btOverlapFilterCallback {
virtual bool needBroadphaseCollision(
btBroadphaseProxy* proxy0,
btBroadphaseProxy* proxy1) const;
PyObject *_python_callback;
PT(CallbackObject) _filter_callback_obj;
};
#endif
btBroadphaseInterface *_broadphase;
btCollisionConfiguration *_configuration;
@ -234,15 +229,14 @@ private:
btFilterCallback1 _filter_cb1;
btFilterCallback2 _filter_cb2;
#ifdef HAVE_PYTHON
btFilterCallback3 _filter_cb3;
#endif
btSoftBodyWorldInfo _info;
PT(CallbackObject) _tick_callback_obj;
PT(BulletDebugNode) _debug;
btSoftBodyWorldInfo _info;
BulletRigidBodies _bodies;
BulletSoftBodies _softbodies;
BulletGhosts _ghosts;

View File

@ -27,6 +27,7 @@
#include "bulletConvexPointCloudShape.h"
#include "bulletCylinderShape.h"
#include "bulletDebugNode.h"
#include "bulletFilterCallbackData.h"
#include "bulletGenericConstraint.h"
#include "bulletGhostNode.h"
#include "bulletHeightfieldShape.h"
@ -40,6 +41,7 @@
#include "bulletSphericalConstraint.h"
#include "bulletSoftBodyNode.h"
#include "bulletSoftBodyShape.h"
#include "bulletTickCallbackData.h"
#include "bulletTriangleMesh.h"
#include "bulletTriangleMeshShape.h"
#include "bulletVehicle.h"
@ -158,7 +160,7 @@ init_libbullet() {
BulletConvexPointCloudShape::init_type();
BulletCylinderShape::init_type();
BulletDebugNode::init_type();
BulletSphericalConstraint::init_type();
BulletFilterCallbackData::init_type();
BulletGenericConstraint::init_type();
BulletGhostNode::init_type();
BulletHeightfieldShape::init_type();
@ -169,8 +171,10 @@ init_libbullet() {
BulletShape::init_type();
BulletSliderConstraint::init_type();
BulletSphereShape::init_type();
BulletSphericalConstraint::init_type();
BulletSoftBodyNode::init_type();
BulletSoftBodyShape::init_type();
BulletTickCallbackData::init_type();
BulletTriangleMesh::init_type();
BulletTriangleMeshShape::init_type();
BulletVehicle::init_type();

View File

@ -17,6 +17,7 @@
#include "bulletCharacterControllerNode.cxx"
#include "bulletCylinderShape.cxx"
#include "bulletDebugNode.cxx"
#include "bulletFilterCallbackData.cxx"
#include "bulletGenericConstraint.cxx"
#include "bulletGhostNode.cxx"
#include "bulletHelper.cxx"
@ -36,6 +37,7 @@
#include "bulletSoftBodyMaterial.cxx"
#include "bulletSoftBodyShape.cxx"
#include "bulletSoftBodyWorldInfo.cxx"
#include "bulletTickCallbackData.cxx"
#include "bulletTriangleMesh.cxx"
#include "bulletTriangleMeshShape.cxx"
#include "bulletVehicle.cxx"