Irrlicht, iPhysics and Mac OS X
Posted: Fri Jun 29, 2007 12:02 pm
Well, first of all, hi guys I'm a new member, as you can see. A friend of mine and I started using Irrlicht a few weeks ago for an adventure game. We decided to use Irrlicht because of its portability, and we started implementing the physics engine using Newton and iPhysics. Here is the problem.
We wrote the code on a Windows machine, and we had no problems compiling it with the physics engine, all is working well.
But when I tried porting it to Mac OS X, I got in trouble.
First of all, I found that iPhysics isn't well documented and that there isn't an official port of it for the Mac platform; so I decided to compile it by myself using X-Code 2.4, but it happened that I got thousands of error complaining something wrong about _cdecl. Searching over the net, I found that _cdecl is a Windows-specific calling convention, that Mac OS X can't understand. I tried almost everything - even delete the _cdecl from the code and include a GCC cdecl.h C++ header for Mac OS X - and finally I managed to compile it well into a .a library. I included it with libnewton32.a and Irrlicht.a in my project and everything went well. Or at least is what I thought, until I launched the program.
As a matter of fact, I discovered that the physics is only partially working: the gravity force works well, but the collisions don't. For example, many objects that I imported just go throw the floor and then fall down into the nothing, desappearing from the window.
I checked my code, and everything is OK; I compiled it with Windows 2000 and the latest release of DevC++ and everything is working just how I expected. I got this strange problem only on Mac OS X.
Agasa (which is the friend of mine who's working with me) think that the gravity callback works because it's specified in iPhysics; instead the collision callback is not working because it's hardcoded in Newton. However, we have no ideas about how to write a callback to force collisions to work.
Could anyone give me some hints? I am using Irrlicht 1.2, Newton 1.5.3 and iPhysics 1.5 on Mac OS X 10.4 Tiger.
Sherry Haibara
P.S.
Sorry for my far-from-perfect english, I'm from Italy.
We wrote the code on a Windows machine, and we had no problems compiling it with the physics engine, all is working well.
But when I tried porting it to Mac OS X, I got in trouble.
First of all, I found that iPhysics isn't well documented and that there isn't an official port of it for the Mac platform; so I decided to compile it by myself using X-Code 2.4, but it happened that I got thousands of error complaining something wrong about _cdecl. Searching over the net, I found that _cdecl is a Windows-specific calling convention, that Mac OS X can't understand. I tried almost everything - even delete the _cdecl from the code and include a GCC cdecl.h C++ header for Mac OS X - and finally I managed to compile it well into a .a library. I included it with libnewton32.a and Irrlicht.a in my project and everything went well. Or at least is what I thought, until I launched the program.
As a matter of fact, I discovered that the physics is only partially working: the gravity force works well, but the collisions don't. For example, many objects that I imported just go throw the floor and then fall down into the nothing, desappearing from the window.
I checked my code, and everything is OK; I compiled it with Windows 2000 and the latest release of DevC++ and everything is working just how I expected. I got this strange problem only on Mac OS X.
Agasa (which is the friend of mine who's working with me) think that the gravity callback works because it's specified in iPhysics; instead the collision callback is not working because it's hardcoded in Newton. However, we have no ideas about how to write a callback to force collisions to work.
Could anyone give me some hints? I am using Irrlicht 1.2, Newton 1.5.3 and iPhysics 1.5 on Mac OS X 10.4 Tiger.
Sherry Haibara
P.S.
Sorry for my far-from-perfect english, I'm from Italy.