Panda Bullet


About the 64 bit thing, I run 64 bit Windows 7, and it works perfectly fine for me.


Hey, what would be the best way of getting the class instance that a collision ray is colliding with?

I need this so I can call a function on this instance when ever someone clicks it with the mouse.


problem! what did i do wrong?

c:\Panda3D-1.7.0\bullet\libpandabullet>python waf configure
Setting top to                           : c:\Panda3D-1.7.0\bullet\libpandabulle
Setting out to                           : c:\Panda3D-1.7.0\bullet\libpandabulle
Checking for 'msvc' (c++ compiler)       : ok
'configure' finished successfully (0.440s)

c:\Panda3D-1.7.0\bullet\libpandabullet>python waf build install clean
Waf: Entering directory `c:\Panda3D-1.7.0\bullet\libpandabullet\built'
[1/6] libbullet_igate.cxx src\bulletAllHitsRayResult.h src\bulletB
ody.h src\bulletBoxShape.h src\bulletCapsuleShape.h src\bulletCharacterControlle
rNode.h src\bulletClosestHitRayResult.h src\bulletClosestHitSweepResult.h src\bu
lletConeShape.h src\bulletConeTwistConstraint.h src\bulletConstraint.h src\bulle
tContactCallbacks.h src\bulletContactResult.h src\bulletConvexHullShape.h src\bu
lletConvexPointCloudShape.h src\bulletCylinderShape.h src\bulletDebugNode.h src\
bulletDistanceConstraint.h src\bulletGenericConstraint.h src\bulletGhostNode.h s
rc\bulletHeightfieldShape.h src\bulletHelper.h src\bulletHingeConstraint.h src\b
ulletManager.h src\bulletManifoldPoint.h src\bulletPersistentManifold.h src\bull
etPlaneShape.h src\bulletRigidBodyNode.h src\bulletShape.h src\bulletSliderConst
raint.h src\bulletSoftBodyConfig.h src\bulletSoftBodyHelper.h src\bulletSoftBody
Node.h src\bulletSoftBodyShape.h src\bulletSoftBodyWorldInfo.h src\bulletSphereS
hape.h src\bulletTriangleMesh.h src\bulletTriangleMeshShape.h src\bulletVehicle.
h src\bulletWheel.h src\bullet_includes.h src\bullet_symbols.h src\bullet_utils.
h src\config_bullet.h -> built\libbullet_igate.cxx built\
    *** Error in bullet_utils.h near line 31, column 73:
    parse error
Error parsing file: 'bulletAllHitsRayResult.h'
Waf: Leaving directory `c:\Panda3D-1.7.0\bullet\libpandabullet\built'
Build failed
 -> task failed (exit status 1):
        {task 45373456: libbullet_igate.cxx bulletAllHitsRayResult.
et_utils.h,config_bullet.h -> libbullet_igate.cxx,}
' interrogate -srcdir ../src -I../src -Dvolatile -Dmutable -DCPPPARSER -D__STDC_
_=1 -D__cplusplus -D__inline -longlong __int64 -D_X86_ -DWIN32_VC -D_WIN32 -D_MS
C_VER=1500 -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall -DF
ORCE_INLINING -oc libbullet_igate.cxx -od -fnames -string -refcount
 -assert -python-native -S"../src/parser-inc" -S"C:\\Program Files/Panda3D-1.7.1
/include" -S"C:\\Program Files/Panda3D-1.7.1/include/parser-inc" -DBUILDING_PAND
ABULLET -module pandabullet -library libbullet bulletAllHitsRayResult.h bulletBo
dy.h bulletBoxShape.h bulletCapsuleShape.h bulletCharacterControllerNode.h bulle
tClosestHitRayResult.h bulletClosestHitSweepResult.h bulletConeShape.h bulletCon
eTwistConstraint.h bulletConstraint.h bulletContactCallbacks.h bulletContactResu
lt.h bulletConvexHullShape.h bulletConvexPointCloudShape.h bulletCylinderShape.h
 bulletDebugNode.h bulletDistanceConstraint.h bulletGenericConstraint.h bulletGh
ostNode.h bulletHeightfieldShape.h bulletHelper.h bulletHingeConstraint.h bullet
Manager.h bulletManifoldPoint.h bulletPersistentManifold.h bulletPlaneShape.h bu
lletRigidBodyNode.h bulletShape.h bulletSliderConstraint.h bulletSoftBodyConfig.
h bulletSoftBodyHelper.h bulletSoftBodyNode.h bulletSoftBodyShape.h bulletSoftBo
dyWorldInfo.h bulletSphereShape.h bulletTriangleMesh.h bulletTriangleMeshShape.h
 bulletVehicle.h bulletWheel.h bullet_includes.h bullet_symbols.h bullet_utils.h
 config_bullet.h bullet_composite.cxx '



I had that problem, I think I had to download and install bullet onto my PC… google it, lemme know if it works


The object which has been hit by the ray can be accessed via “getNode”. When testing for a single hit (rayTestClosest):

result = mgr.rayTestClosest(...)
node = result.getNode()

And when testing for all hits (rayTestAll):

result = mgr.rayTestAll(...)
for hit in result:
    node = hit.getNode()

The returned object is one of the libpandabullet nodes, e. g. BulletRigidBodyNode.

To get the type of this node you can use the standard Python “type()” method, and you can also use the PandaNode tags or python tags to store additional information on the node when creating it.


Impossible to say with the few information provided. But, like powerpup118 suggested, the most likely reason is that you forgot to download and compile Bullet. Open the “wscript” file and make sure that all paths are valid on your computer, especially the ones who point to your Bullet libraries:

    # Bullet

If not modify them to match your needs.

By the way: Is there a particular reason why you try to compile yourself? Oh, and if you download the Bullet sources yourself make sure you apply the above mentioned fix to src/BulletDynamics/Character/btKinematicCharacterController.cpp.


I didnt see an installer, is there one?


How would I create and access these tags? Sorry, but I have never used such things before.


Like this (or look into the NodePath API)

np.setPythonTag('myAmazingClass', myRealClass)
myRealClass = np.getPythonTag('myAmazingClass')

you can store python objects in the nodepath, and retrieve them later.
Hope this helps


No. I don’t see any need for an installer. Just copy the library (.pyd) to whereever you develop your game.


Some more info: There are two “tag” systems, the C++ tags (setTag, getTag) and the Python tags (setPythonTag, getPythonTag). The C++ tags are basically a dictionary with string keys and string values, and the Python tags are a dictionary with string keys and PyObject values.


i did this and when i try and run the first test file ( i get

DirectStart: Starting the game.
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
  File "", line 20, in <module>
    from libpandabullet import BulletManager
ImportError: DLL load failed: The specified procedure could not be found.

i copied the manifest, the PYD and the SO into python’s library/site-packages folder, without putting it into any other folder


The self-compiled, or the .pdy from the download? What folder precisely - there is no “library” in any Python distribution? What Python version? The Python which comes with Panda3D or your local distribution? And what VC runtimes do you have installed? Please try to be a bit more verbose.

Sidenote: is the Linux library. You don’t need it on Windows.


the one from the download.

oops, meant Lib

the one that comes with panda.



Putting libpandabullet.pdy in lib/site-packages of the Python version which comes with Panda3D should work. However, a better places would be Panda3D’s ./bin directory. This is where the library will be once it is added to Panda3D’s codebase. You will see a lot of libpanda***.dll files there already.

Next questions: What version of Panda3D are you using? What OS are you using (assuming it is Windows - XP, Vista, 2003, 7, …) and is it 32bit or 64bit?

VC is short for Visual C, but if you have Studio 2008 installed I assume the VC runtime is ok. If not this would be a reason for compiling yourself.


Panda3D 1.7.0, Windows Vista Home Basic 32 bit. There are no pyd files in panda’s bin directory, most of them are in python’s DLL folder.


You are using a Panda3D version which is about one year older than the Panda3D version I used for compiling. You should report such deviations.

On the other hand it seems like the Panda3D snapshot builds are no longer available for download. Hmmm, you might try and use Panda3D 1.7.1 SDK, or compile yourself.

My fault. A .pyd file is nothing but a .dll which has been renamed. Old Python versions picked up libs with both filename extensions. Python 2.6 only picks up .pyd, if not loading the .dll directly (which is what Panda3D does).


Oh wow, this is awesome, i am checking demos to get a feel on how to use it :slight_smile:

There is one small bug

OS: win 7x64
panda: recent (less than a week) daily build

Ball in maze, when you tilt board so ball falls in bottom-right corner, just at beginning of game, change window focus to something else, and then back to game window, ball just dissapears

Also i noticed that if gravity is set to some higher value, objects shake… (When you move them, and after you stop moving them)
For example in 01_Basics, try setting gravity to 90. And try to 40.
With 40 shaking stops after some time (it probably stops with 90 after some time too, but i was too lazy to wait and see).
After looking more closely, i noticed that object shakes a bit even with “default” gravity


Is there windows binaries? I failed miserably at compiling…


Just download latest version, and run waf.bat, it is in root folder of project.