Hello,
First of all, I’m discovering Panda3D with pleasure, and I think I get the right engine to work with, after having played a bit with Ogre and Irrlicht.
I’m thinking of mixing Python and native code for performance reasons. I want to port to Panda an existing C#/DirectX project where thousands of particles are continually colliding. The particle system has to be optimized as much as possible and I want to code it in C++.
Different methods :
-
The particles are created and rendered with Python. When performing the collision, a C++ function is called and operated on the array (ctypes passing an array or with a custom Python module). How do I pass the right pointer ? getParticlesDict ?
-
The whole project is written in C++, and if I want to use python, I have to load and execute the scripts by myself
-
I extend Panda3D (and then have to recompile parts of the source) adding a new class derived from ParticleSystem, and use it like a classical particle system from the python code
The best for me would be to directly access the engine created in the Python context, from a C++ thread or set of classes (say, in a DLL).
I’d prefer avoiding huge transfers of data and being able to upload the vertex/index data to the video card without passing by the Python context.