PandaNode usage

I have tried to find any code examples of how to inherit from PandaNode. Ideally I would like to inherit from one of the BulletBodyNodes to get the physics included in my “actor” class. The first problem I encounter is to load the egg file to the new class. I guess this is a very basic piece of code but I can only find examples of actors inherit from NodePath which is not what I want ( … l/cActor.h). Could anyone enlighten a Panda3d noob? Thanks!

It should work just fine to inherit from any PandaNode class, although it’s usually not a particularly good approach for implementing game objects (since game objects are typically more high level than scene graph nodes, and it creates too many complications). You cannot override the .egg loader to create objects of your custom class, you will have to search the scene graph and replace the nodes in question or add a loaded .egg file as a child of your custom node.

(You can, however, implement the serialisation methods on PandaNode to make it loadable from and writable to .bam files. This is another matter entirely, though.)