Is there a ogreNewt Version for Mac OS X?

dwayne

27-05-2009 14:10:36

Hey guys!
I am working on a project for my university where you can use a Wiimote within a game. I want to use Newton Dynamics for physics and tried to build a ogreNewt.Framework with Newton 2.0 and the current version of OgreNewt, but without any success.
Is there anyone who made a Framework or lib for OS X which can be used? Or if someone could give me some instructions how to do this?

The only "usable" version I found was a modified one, so my application crashes when I follow the OgreNewt tutorials. My project will support Win32 too, so I need a "clean" version.

Any help is very very welcome!!! :-)

Virginie

27-05-2009 14:28:17

Normally they are only one OgreNewt for all system and choose the good Newton for your system.
Maybe you should use the 1.53 version because the 2.0 is a beta version but it should work too.

Have you take the OgreNewt for 2.0 version of Newton and no the OgreNewt for 1.53 if you use Newton 2.0?

dwayne

27-05-2009 16:12:35

At first, thanks for your help!
I tried both versions, but maybe I am doing it completely wrong?!

I've tested two ways of it:

1. Get the OgreNewt sources, try to compile them and add the built library to my project (where the libnewton32.a also is included).

2. Add the sources of OgreNewt, the libnewton32.a,… to my project and build it.

The second way seems to be the right one. I had to fix the Newton.h because of this error: "size_t has not been declared" I fixed it with #include <stdlib.h>
Now I am able to include OgreNewt.h in my project, define some vars in my header and use them. For the beginning just a construtor call:

mWorld = new OgreNewt::World();

But when I compile my app I get the following linker error:

"OgreNewt::World::World()", referenced from:
myOgreApplication::myOgreApplication(Ogre::Root*, Ogre::RenderWindow*)in myOgreApplication.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


I think maybe I missed some settings for my project but I am sure that I add everything I need.

Virginie

27-05-2009 16:29:16

Hum, it seems you are bad install OgreNewt.

I don't work in MacOS.
Have youu see this : http://www.ogre3d.org/wiki/index.php/Ne ... e_Dynamics

?

Zero23

27-05-2009 19:49:41

It look like, that it cant find the lib of OgreNewt!
Do you compiled them and do you link that lib against your application?

Zero

dwayne

27-05-2009 20:22:50

Thank you Virgine, you pointed me in the right direction! :-)
Okay, I reordered my directory structure like in the tutorial, it's a little bit different with OS X but it worked.
There where some issues in the code and some linker stuff to do but the library got built and I am able to run Demo01! :-)

Now I followed the further instructions and added the lib etc to my own project but there it isn't working anymore.
I'm getting this compiler error:
OgreNewt.h: No such file or directory

from this include:
#include <OgreNewt.h>

Seems weird because I added /Developer/OgreSDK/ogreaddons/OgreNewt/OgreNewt_Main/inc to my "User Header Search Paths"…

Virginie

28-05-2009 08:53:21

I don't know about you but my OgreNewt 2.0 has this way :
OgreNewt-2.0\inc

without /OgreNewt_Main/

check where is your OgreNewt.h

dwayne

28-05-2009 17:15:16

Okay guys, here is what I got:

The Version of OgreNewt I had was not a current one, some older version. So I found the current version at ogres svn and downloaded it.
There is an Xcode project and i was able to built the framework without any problems! :)

Including it into my project is also working, but when i create a OgreNewt::ConvexCollisionPtr it crashes because of
dyld: lazy symbol binding failed: Symbol not found: __ZN8OgreNewt4BodyC1EPKNS_5WorldERKN5boost10shared_ptrINS_9CollisionEEEi

Seems like boost isn't linked properly or? Do I have to integrate boost into my project or did I something wrong when I built OgreNewt?

dwayne

28-05-2009 18:40:05

I compiled the lib again with gcc-3.3 and now it runs somehow but still crashes at certain points. :(
btw, it's Newton 2.0 now.

everytime I try to do the following:

(Code is taken from the samples)

Creating my pointer:
OgreNewt::ConvexCollisionPtr col = OgreNewt::ConvexCollisionPtr(new OgreNewt::CollisionPrimitives::Cylinder(mWorld, 1, 1));
OgreNewt::Body* body = new OgreNewt::Body( mWorld, col );

When I call

col->calculateInertialMatrix(inertia, offset);

or

body->setVelocity( (dir * 50.0) );

it crashes...
[attachment=0]Bild 2.jpg[/attachment]

djbe

29-05-2009 01:03:26

Hey,

I just finished a school project that uses ogrenewt. You can find some info about it here, and all the files here. If you download the source zip file, it contains the source code, project files, and binaries for the used frameworks for both mac and windows, and for each platform in debug and release.
Cya!

Virginie

29-05-2009 08:20:01

Have you the last version for boost? Because the older haven't many classe which some for CollisionPtr.
I'm not very good in english so I don't understand all so to be sure that you have all good:
OgreNewt for 2.0 by svn : https://ogreaddons.svn.sourceforge.net/ ... /newton20/
Newton 2.0 : http://www.newtondynamics.com/forum/vie ... f=9&t=4922
Boost : http://www.boost.org/

And I don't know if you can do col->calculateInertialMatrix(inertia, offset);

I think you must do :

OgreNewt::CollisionPrimitives::Cylinder *cylinder = new OgreNewt::CollisionPrimitives::Cylinder(mWorld, 1, 1)
OgreNewt::ConvexCollisionPtr col = OgreNewt::ConvexCollisionPtr(cylinder);
OgreNewt::Body* body = new OgreNewt::Body( mWorld, col );

Ogre::Vector3 inertie,offset;
cylinder->calculateInertialMatrix(inertie,offset);