Panda PhysX


I don’t think that the SDK will help. Please try to disable hardware acceleration in PhysX settings, and if this does not help try to install the older PhysX_8.04.25_SystemSoftware.exe driver:



BMCha, how could you get glxGraphicsPipe on Windows ?


Success! Disabling Geforce PhysX worked. Thanks for all the help.

And I don’t exactly understand you question ynjh_jo. That refers to Panda using OpenGL to display, right?


Up to v1.5.3, on Linux, it’s glx.
On Windows, it’s wgl or wdx.


Now I remember, I didn’t feel like typing all the generic console messages, so I found someone’s console log and copied in the first few lines. For me it actually is wgl, though.


Glad it works now, but it’s not yet “success”. Current state is that some users (you are the only one so far :slight_smile: can’t use hardware accelleration even if it should be possbile on their hardware. Not a satisfying status for me.

I will try to find a solution, but move this to PM until we have a result.

No need to typ everything.
In the console window, upper left corner of the window decoration, there is a icon, and the icon has a context menu. Select “Properties”, and in the properties window enable “Quick edit mode” and “Insert mode”. Then you can mark text with your mouse and copy it by pressing the “enter” key.



Hi enn0x,

Thanx for all the effort you are putting into this. I am just wondering, does the current version of your work support cloth simulations? or not yet?


Not yet. It’s on my todo list, but somewhere in the middle. Next things will be vehicles and more maintenance for basic features. I don’t want to propose a date, but maybe around christmas.


#20 (3.3M)

Another maintainance release. Also some code cleanup has happened and some new features have been added:

  • Adds overlap testing (sphere, capsule).
  • Adds shapeType parameter to raycasting and overlap testing.
  • Classes without PUBLISHED methods get now wrapped too, e.g. PhysConvexShape.
  • Adds a method to set ShapeFlags on shape descriptors.
  • Adds methods to set the global position & orientation on PhysActors.
  • Adds methods to set the maximum angular velocity on PhysActors.
  • Adds methods to set/get the skin width of a shape or shape descriptor.
  • Adds wheel shapes (PhysWheelShape, PhysWheelShapeDesc).
  • Adds contact reporting.
  • Adds methods to query/control sleeping of PhysActor.
  • Fixed a bug in PhysController.setH().
  • Adds documentation for several more methods.

(see included file doc/RELEASE-NOTES.txt)

The included binaries are built for Panda3D-1.5.4.



I’m in need of some help with the cooking process. When cooking a custom model, the kitchen returns a status of 1, so it does work. But when loading the model in the convex sample (, I replace the tetra model with my custom model, I get these assertion failures:

I am quite new to Panda, Python and PhysX, but just editing a filename can’t be the problem, must be the model. The egg model was exported from 3dsmax 8.
Please help.


There are three possible problems:

1.) How did you cook the mesh? Using PhysKitchen( ).cookTriangleMesh or using PhysKitchen( ).cookConvexMesh? If you open the .nxb file created by the Kitchen, what are the first characters (“NXSMESH” or “NXSCVXM”)?

2.) The implementations of the Kitchen methods are not very clever, they just try to find vertices and use them as a vertex cloud. This is fine for simple meshes. Maybe the Max exporter has some features which cause problems. Can you send me the .egg file for analysis?

3.) Problems with the filepath. I assume you checked this already.




  1. It’s using cookTriangleMesh.

  2. I tried the steps.egg model that comes with your samples.

  3. Yip, checked the paths. I believe it would give a different error for this though, would it not? The start in path is same as the file’s folder.


If you cook something as a triangle mesh then you have to load it again as a triangle mesh. If you cook something as a convex mesh then you have to load it as a convex mesh.

Triangle meshes and convex meshes are not the same binary files, even though I use the same filename extension (.nxb) for both in my samples. You can use different extensions if this helps you keeping your models organized.

Please note that triangle meshes are for static geometry (things that never move), and convex meshes are for dynamic geometry (things that move around in the scene).



Thanks, I’m getting things to work now, finally.

Just want to know…
When I want to use a shape like the capsule, does my model have to be centered over the origin, or must it be placed above the origin? Is there a way to set the direction of it?


I don’t understand your question, sorry. Can you elaborate a little bit about what you mean with “model” and “origin”? Best would be to use Pand3D or PandaPhysX class names.

You mean the NodePath assigend to a PhysActor, or the PhysShape added to the PhysActor?

“Origin” is a property of a coordinate system. There are several coordinate systems involved, for example the global CS or rendered geometry (NodePath “render”), the local CS of a NodePath (relative to it’s parent NodePath), the CS of the PhysScene, the global CS of a PhysActor (relative to the PhysScene), the local CS of a physShape (relative to PhysActor), just to name the most important ones.



When I say model I meant the actual model that the 3d artist builds in Blender or etc. and with shape I meant both the PhysShape and the blender model’s shape.
About the origin, I meant the model origin, as in blender. Example:

About the direction. Why I ask is because I get this result:

The capsule is rolling sideways and the model is obviously not correctly oriented with the PhysShape or whatever. I don’t know, thats why I ask. This is my code:

		tmpshape = PhysCapsuleShapeDesc()
		tmpshape.setHeight( 1.8 )
		tmpshape.setRadius( 0.35 )

		tmpbody = PhysBodyDesc( )
		tmpbody.setMass( weight )

		tmpactor = PhysActorDesc( )
		tmpactor.setBody( tmpbody )
		tmpactor.addShape( tmpshape )
		tmpactor.setGlobalPos( self.m_Model.getPos(render) )

		self.m_PhXActor = world.m_PhXScene.createActor( tmpactor )
		self.m_PhXActor.attachNodePath( self.m_Model )


Not really obvious, since the screenshot only shows rendered geometry. It does not show the collision geometry. Turn on physx debug rendering, and do another screenshot. Then it will be obvious.

My best guess it that you have aligned the visible capsule along the z-axis. Your blender screenshots don’t reveral what axis is up, so making random guesses is verything I can do. PhysCapsuleShape is aligned along the y-axis.

If this is true then you have two options. Both ways work fine:
1.) either rotate the PhysCapsuleShape by setting a local transform.
2.) or rotate your visible geometry in Blender, then export again.



Thanks for the help so far enn0x.

I just rotated the visible geometry for now, but it was the PhysCapsuleShape’s local transform that I was really looking for, I believe.

Anyway, is there a way to visualize a PhysRay when rendering the PhysScene’s debug node? I’m trying to use the PhysRay for a 3rd Person camera to check if its going through anything.

By the way, PhysX works 10x better and easier than ODE, in my opinion.


The rays used in raycasting are not part of the PhysScene, they are just temporary objects. The debug renderer can not show them.

There are two other options for visualizing them:

1.) What I have done in the raycast sample: use two spheres, and move them to the origin and the end of the ray every frame.

2.) Use the Panda3D class “LineSegs” to create a NodePath which is a line from the ray’s origin to it’s end every frame. If I find some time I will modify the raycast sample this way for the next release.

Performance is not an issue here since this is just for debugging.

Thanks, but it comes at a high cost: PhysX is not open source, and my bindings for PhysX are still at an early stage.



Hey enn0x,
Is there a way to monitor whether a PhysActor or shape has been hit by a raycast?

I saw that the PhysShape can be set to be a trigger. Could it be done with a RayCast? I thought of creating a trigger physshape at the ray’s hit point, but maybe there’s a better way?