O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding NodePath functionality to a custom class

The next custom class we're going to make will be the Cycle class, which will represent our characters, the hover cycles for us. Later on, when we start to have these characters interact with one another, we'll want to be able to use NodePath-type operations such as setPos on them. That means we need to add NodePath functionality to the class.

Before we jump the gun and try to inherit from NodePath when we make the class, like how the World class inherits from DirectObject, there's something we need to understand about Panda3D. In order to make Panda3D run faster, many of its classes are written in C++, NodePath included among them. These C++ classes can't be directly inherited from by a class in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required