By the way, is there a way to specify which bodies should be ignored during raytest? Bullet manual says only about collision masks, so I’m afraid the only way to ignore some bodies in raytest is to iterate over rayTestAll results and filter it manually… Or there are other solutions?
The proper way to do it (in C++, sorry) would be to override RayResultCallback::needsCollision and check if the object hit should be filtered or not.
I have not implemented this so far, but it is very high on my todo list. I will probably add an additional parameter to the rayTest methods, which will be a BitMask32.
I found the problem; going into the Blender model, I found that the scale on the model was set to .01. For some reason, although Panda auto scaled the model to match the Blender scale, Bullet did not.
About the scaling: there is no magic auto-scaling by Panda. All scales which have been set within Blender get exported to the .egg file. When loading this .egg file you create a small tree of PandaNodes, which will have non-identity transforms if there have been non-identity transforms in Blender. Now you pass a single Geom (not the GeomNode!) to mesh.addGeom(geom). A Geom does not know anything about the transforms which have been set on the owning GeomNode or any of the PandaNodes which are the GeomNode’s parents.
Would it not be possible, after I have imported all the geoms, to find out the correct scaling from Panda (since it has the whole model), then auto apply it to the physics mesh?
This would be a BulletHingeConstraint. A small warning: I have not tested the constraints well, and there is just one small example showing basic constraint usage. There might be a good deal of bugs.
I would appreciate feedback if you managed to get a ragdoll example done. With such input I could create a C++ convenience class for Ragdolls, and maybe a factory which takes an Panda3D Actor and returns a read-to-use ragdoll.
This is already in process. Some of the pages are there already, just not linked to the table of contents. Once the manual pages are halfway complete we will link it.
Okay, I tried the hinge constraint, but found there was no way of moving it around, so its not very practical for joints.
I still know no good way of attaching two physics bodies together.
Here is what I would like to be able to do:
Attach my lower leg physics node to a hinge constraint, and attach the constraint to the upper leg physics node at the position where they should meet. Then when I move the lower leg physics node, it moves the upper leg, and vise versa.