Rigid Body Combiner

I don’t think I’m doing it right, because my Actors all disappear when running the app and fps goes down.

RrigBc = RigidBodyCombiner("MM1RigBodC");
RrigBc_NP = NodePath(RrigBc);
RrigBc_NP.reparentTo(render);
self.ObjTest1 = Actor(MYGameDIR+"files/testers/obj1/model/ObjTest1               
self.ObjTest1.reparentTo(RrigBc_NP);
RrigBc.collect();

Actors are not meant to be used with the RigidBodyCombiner. Only rigid (non-internally-animating) bodies are meant for this class.

David

I see.

Another question -

If I call flattenStrong on a none animated object, but want to do some random scaling, position change and rotating on that object later, would that disable the effect of flattenStrong()?

Is it safe to create more than one Rig Bod Cont? or put everything that’s not animated in one container?

Not sure what you mean. The first call to flattenStrong() would (among other things) apply your original transform, whatever it is, onto the vertices, and remove it from the node. This means that the vertices are now permanently changed into the current transform. You can now apply a new transform, which applies on top of whatever the original transform was (since that has been moved to the vertices).

Now you have a node with a transform again. Since one of the benefits of flattenStrong() is to remove the transform from the node, and transforms aren’t completely free, you have undone one of the benefits of flattenStrong(). However, this is a comparatively tiny benefit; the biggest benefit is the fact that flattenStrong() has combined all of the child geometry into a single Geom (or as few as possible), and you’ll probably never notice the extra cost of an additional transform in the scene.

Of course, you can try this out and see what happens too. :slight_smile:

It is safe. If you needlessly divide your scene into too many RBC’s, you won’t gain as much benefit as if you had combined everything; but sometimes it makes more sense to keep things separated. It depends on your particular scene.

David