Panda3D Manual: Reference Counting

WRITEME: this article is a stub. Please help by expanding it.

This page will explain about Panda3D's smart Reference Counting system.

Some Panda3D classes use this system. You can check if such a class is Reference Counted by checking in the List of Classes if it inherits from ReferenceCount.

Such classes, for example Texture, or TextNode, are created like this:

//  Create the PointerTo object
PT(TextNode) myVar;
// Assign a new TextNode to it
myVar = new TextNode("title");
 
// Now, you can do with it what you want, treat it like a pointer:
 
myVar->set_text("I am a reference counted TextNode!");