basic Python OGRE questions

drakide

29-05-2011 17:12:36

hello everyone!
I am trying to run python-OGRE on my laptop without any success until now D:
Anyway, that is not the problem I have right now, it would be too early to claim your help for that, because I wasn't trying very long. However I've got some more basic questions, on which everything depends on:

°)It seems to me like python-OGRE is a OGRE add-on/plugin/... that allows me to "control" OGRE via python. Now what happens if I want to use another plugin too? Do I need to control that plugin via native C++ Code then?
°)Does python-OGRE support multi-threading? Since my game would be quite processor-heavy no multi threading would be a no-go.

I couldn't find anything about my question on the web and trying is impossible without running python-OGRE...
If I would have to communicate with the other plugins via C++ (or any other language) python-OGRE wouldn't make much sense...

Thanks in advance, sorry for any mistakes.

Mohican

31-05-2011 16:42:41

1) python-ogre contains many C++ 3rd party plugins, such as raknet or ODE.
To use these libraries, a python wrapper is compiled using boost.
Writing a wrapper is not so difficult, especially since so many libraries have already been wrapped.
You can read through the existing wrappers, and copy/paste large sections to make a new one.
Once the wrapper is compiled, you import it like any other python module.

2) python 2.7.x supports multi-threading, and so does ogre 1.7.x.
If you compile the wrapper with the correct settings, then the result should be multi-threaded.

A couple of final words:
If you plan to write CPU intensive code, then don't write it in python itself.
The heavy work should be done by C++ code (ie, ogre itself or one of the other libraries like ODE/Bullet)
So... don't write matrix inversion code in python, it would be a waste of time!

Remember that python should only be the glue that holds your code together.
That's what it's really great for!

drakide

01-06-2011 15:07:06

Sounds great!

Remember that python should only be the glue that holds your code together.
I want to do exactly this with python. C is doing the hard work, python controls C.