Panda Bullet

By order on how useful things were to me.

Example by ennox (you can download latest zipped release examples are included).

Panda python bullet reference, bullet docs.
There is also bullet docs in panda manual, its not in toc, so just do a search for bullet.

This section of the Panda3D manual might explain what is going on:
http://www.panda3d.org/manual/index.php/Lenses_and_Field_of_View
Please consider turning on visualisation for the camera field of view and and the bounding box of the BulletDebugNode.

I use a, well, less recommended way for rendering the debug geometry. That is, I don’t get pointers to geom etc. with “get_modify_*” methods each frame, but keep pointers to these objects. I really expect this method to have a few quirks, but on the other hand it is way faster than all other methods I have tried.

Anyway, I will have a look at how to improve this once I have time again to do some Panda3D work.

My recommendation would the the following sequence:

  • Start with the Panda3D manual pages.
  • Then look at the samples provided within this thread.
  • Next, look through the Panda3D API docs.
  • Finally, look at the original Bullet documentation.

One of the best things about Bullet and Panda3D is that both are open source. This means you have access to the most accurate and non-ambiguous documentation anybody could wish for, so Feel the source, Luke!

Without further analysis: I guess what is going wrong is that I do not compute proper bouding boxes for the debug geometry. Thus it gets clipped away when rendering the scene. I’m positive that this can be fixed.

How can I find the pages in the manual which are not in the table of contents?

panda3d.org/manual/index.php … th_Panda3D

if posting such links is not allowed, mods remove it :slight_smile:

only 2 pages seem to be empty, the rest seems complete. Good job on that!
Another question: is there a problem if I’ll use Panda’s collision detection together with Bullet’s physics/constraints, etc?

PS. Will the Bullet samples be included in the next SDK? Right now Bullet is included in Panda, but docs are scattered here and there: manual pages aren’t in toc (yet) and sample demos are in the download of the old version of pandabullet when it was still not in panda

Ok, I’m sure you’ll fix it!

Just fyi: I did notice another weird behaviour on debug bounding boxes.

I have some BulletRigidBodyNode setup as kinematics, when these nodes are moving it appears that their associated debug bounding boxes are lagging behind.
It usually takes a few frames (I’d say 4 or 5) to get in sync… and the phenomenon goes on cyclically if the kinematics nodes keep moving…

Can you please provide a screenshot where the bounds and tight bounds of the BulletDebugNode are shown (thats np.showBounds() and np.showTightBounds())

I don’t understand what you want to say. Are you talking about the NodePath bounds or tight bounds? Or are you talking about the Bullet AABBs which get displayed when setting verbose mode on the BulletDebugNode? Or are you talking about the Bullet collision shapes?

You’ll find 3 screenshots from setup:

DebugNode = new BulletDebugNode("Debug");
DebugNode->set_verbose(true);
NodePath debugNP = render.attach_new_node(DebugNode);
mgr->set_debug_node(DebugNode);
debugNP.show();
debugNP.show_bounds();
debugNP.show_tight_bounds();

b symptom 1:[/b] debug node shown disapearing depending on the camera position
https://rapidshare.com/files/3255032062/CapturePilar.JPG
https://rapidshare.com/files/3790217323/CapturePilar2.JPG
Here if the camera gets close to the pilars, then the debug boxes disappear.

b symptom 2:[/b] the whole debug node display is lagging behind when moving a kinetic. Here I have attached a sphere BulletRigidBodyNode to the hand of the character, whenever the character moves its hand the whole bullet debug block (red one) is lagging behind and is not synchronized with the hand movement
https://rapidshare.com/files/1017338485/CaptureHand.JPG

89 x 52 pixels doesn’t show anything recognizable. Do I have to create a pro account?

Hi,
I’m just preparing a short video that should illustrate the two issues mentionned.
I’ll post it in a few minutes.

EDIT: have a look at:
https://rapidshare.com/files/2346748921/bullettest.avi
https://rapidshare.com/files/2925578090/disappear.avi

this is a quick & dirty trial to put in evidence the issues. The quality is not optimal, sorry about this.
The lag is less than in my current app, I don’t know why, but have a look at some phases where the bulletdebug’ spheres are late wrt the hands.

I had a look at the two videos, but so far I did not see anything helpful. Have you enabled display for the tight bound & bound of the debug node? Because I didn’t see them.

About the perceived lag, well, there is little I could do. Each frame I ask Bullet to collect the debug geometry, and then rewrite the Geom (vertices and indices). So either Panda3D is not displaying the update geometry (unlikely), or Bullet is not providing the right geometry (unlikely and unfixable), or there is something conceptually wrong with your code.

I have added both points to my todo list, and once I have time again will try to investigate so more.

I could not resist and investigate a little bit into the “dissapearing” debug geometry. I was right, the bounds for this GeomNode do not get update. A quickfix would be to add this such a line after the “self.world.doPhysics(…)” call:

self.debugNP.forceRecomputeBounds()

I will check in a fix soon.

Hi,
Tried the suggested quick fix ( debugNP.force_recompute_bounds() ), initially I noticed an improvement… upto the point I moved the camera on the right side!

So here is the case:
https://rapidshare.com/files/2693881943/disappear2.avi

BTW. I do confirm I’m using
debugNP.show_bounds();
debugNP.show_tight_bounds();

I’m not able to reproduce anything like this with recomputing the PandaNode bounds. And I still don’t see tight bounds or bounds. Is it possible that you recompute bounds and show bounds on the wrong node?

Maybe you can put up a small sample reproducing your problem. This movies are not really useful.

Seems like Sourceforge CVS is currently not available for some projects, among them Panda3D, so I am not able to comit anything. Won’t be for long, I guess.

Why doesnt “from pandac.PandaModules import *” import Bullet (BulletWorld)? It does everyhting else like the audio engines and stuff

And I dont undertsand what the “plain constant is”

And it also seems unusual to set size of primitives with vectors.
BTW, is there a problem in scaling collision spheres? The manual says its not recommended for the built-in collision system

The pandac.PandaModules import mechanism is deprecated and no longer supported for new modules. Use the new “panda3d.bullet” module instead.

The plane constant is the fourth parameter in the plane equation. It is the shortest distance from the plane to (0, 0, 0). So a plane with D=0 would intersect the origin.
In other words, if you were to draw a line orthogonal to the plane and intersecting the origin, then the plane would be translated with respect to the origin by a distance of D.

Vectors seem like a perfectly acceptable way to express dimensions. Note that you can simply subtract the minimum point from the maximum point to get this vector.

I think Anon just wanted to point me at a typo in the manual page. It not the “distance of the plane’s origin”, but the “distance of the plane to the coordinate system’s origin”, like rdb explained. I will fix it this weekend.

Once Bullet works sufficiently and we have more time we can add overloaded method which allow setting dimensions using Vec3 or three floats. But this has very very low priority.