Can anyone post guide for compiling recent OgreNewt???

satchigi

22-05-2011 15:26:35

Hello

I'm new to try using OgreNewt, but i'm stucked on compiling and spending my whole weekend.

Guide for compiling in this board(on the top of entrance) is too old.
so it's too hard to apply in my case using recent OgreNewt.(I downloaded from SVN OgreNewt2979)

i'm using Ogre 1.7.2 SDK
and Visual Studio 2010

and please let me know which version of Newton is profer to intergrate wite recent OgreNewton(2979).

thanks in advance.

ologon

22-05-2011 23:45:16

What errors are you encountering?

I had no issues using the visual studio 2010 solution provided with ogrenewt (Just had to change some wrong include paths) and newton 2.28.

With versions newer than 2.28 there are some slight changes in newton that are not yet implemented in ogrenewt :wink:

satchigi

23-05-2011 00:47:04

My error case is very weird.
It says "MSB3073:The command "copy..\..\lib\OgreNewt.dll .\OgreNewt.dll"

and this error is from Microsoft.CppCommon.targets
(not from file in OgreNewt)

there was not any missing file error. (I guess linked every include and library properly)

ologon

23-05-2011 11:40:09

Hmm, that's weird :?

What version of newton are you using?

I've packed my precompiled binaries of ogrenewt linked against ogre 1.7.2 and newton 2.28:http://www.mediafire.com/?dqm2o1y0e6t3c3g
I've also included the modified solution for vs 2010.

Hope it helps!

EDIT: I've just encountered your error while trying to compile ogrenewt with the latest newton. But visual studio correctly generated the ogrenewt dll, so you can safely ignore it.
Looks like visual studio generates that error because it is trying to copy some dlls to your application directory (which are not required) but can't find them

satchigi

23-05-2011 15:20:56

appreciate. (I tried Newton version 2.16, 2.24)

I'll check right now.

satchigi

23-05-2011 18:43:28

I copied all the dll files into Ogre bin's debug, release folder.
and also copied on OgreNewt's demo folder.

But I got several problems.

When doubleclick on any demo exe file, it is turned off immediatly.
And also, if I use OgreNewt in my project and put some code related OgreNewt, only black screens appear
(just including is Okay. it only happen when I put some OgreNewt code.)

following is what recorded on Ogre.log(inside OgreNewt demo's bin folder)

02:12:44: plugins_d.cfg not found, automatic plugin loading disabled.
02:12:44: *-*-* OGRE Initialising
02:12:44: *-*-* Version 1.7.2 (Cthugha)
02:12:44: OGRE EXCEPTION(6:FileNotFoundException): 'resources_d.cfg' file not found! in ConfigFile::load at ..\..\..\..\OgreMain\src\OgreConfigFile.cpp (line 83)

I think my demo problem's reason is bad link path of resource'_d.cfg.

need your help

ologon

23-05-2011 20:56:31

Yes, maybe you have to copy the resource_d.cfg file into the .exe directory or if you have already copied it,
make sure it contains the right paths (You should use absolute paths to your OgreSDK).

When you use ogrenewt in your application it just crashes?

Okay, then try the following:

* Download newton 2.32 and name its folder "newton232"
* Download my precompiled ogrenewt here (I've included all the folders except demos, because it's a bit large): http://www.mediafire.com/?n3k63uhp1txi0pi

And put its folder in the same place where you put "newton232"

* In your application you need to add the following include directories:
->path-to-ogrenewt \inc
->path-to-newton \coreLibrary_200\source\newton

* In your application add this lib directory:
path-to-ogrenewt \lib\Debug (or Release)\

Add to the linker input "newton_d.lib", "dMath_d.lib", "dJointLibrary_d.lib" and "OgreNewt_d.lib" for debug or without "_d" for release

Finally copy all the three dlls you will find in ogrenewt\lib\Release or Debug\ to your application folder.

Hope it works! :)

satchigi

24-05-2011 14:59:17

I'ts same.

It only gives blackscreen when I try to build tutorial demos. (I added demo's h, cpp files into new ogre project. and I linked include,lib file properly. double checked everything)

and also I put 3 dll files into Ogre bin's debug,release forders. but demo's exe files are not working. when doubleclick, nothing happen.
Maybe I'm confusing method to excute demo's?

and when I add code's in my project like

OgreNewt::BasicFrameListener* mCustomListener;
mCustomListener = new OgreNewt::BasicFrameListener(renderWin, sceneMgr, mWorld, 120);
or
OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::Box(mWorldk,Vector3(10,10,10));
or
Newt::Body* mBody = new OgreNewt::Body(mWorld, col);

the red lines are appear on "(" on those sentence and say "no instance of constructor "~~~" matches the algument list.

ologon

24-05-2011 18:51:31

That's because you are forgetting some parameters

Here's the code you should use for a box:


OgreNewt::BasicFrameListener* mCustomListener;
mCustomListener = new OgreNewt::BasicFrameListener(renderWin, sceneMgr, mWorld, 100);

OgreNewt::CollisionPrimitives::Box* mCol = new OgreNewt::CollisionPrimitives::Box(mWorld, Ogre::Vector3(1, 1, 1), id); //You have to pass an int as id in the last parameter
OgreNewt::CollisionPtr mColPtr = OgreNewt::CollisionPtr(mCol);

OgreNewt::Body* mBody = new OgreNewt::Body( mWorld, mColPtr );

//Mass settings
Ogre::Real mass = 10.0; //Choose a mass here
Ogre::Vector3 inertia, centerOfMass;
mCol->calculateInertialMatrix(inertia, centerOfMass);
inertia*=mass;
mBody->setMassMatrix( mass, inertia );
mBody->setCenterOfMass(centerOfMass);



This will create a box (If you set gravity on the world it will fall). But this box is only "physical" so you won't actually see it (That's why you get a blank screen).

You have to attach an ogre scene node with an entity to it with mBody->attachNode(OgreSceneNode) to actually see its effects

satchigi

24-05-2011 20:03:43

how to get userID?

which one can be used as userID?

I use the code
OgreNewt::Collision* collision

collision->getUserID()

but I don't know which one to put into "()"

ologon

24-05-2011 20:30:37

Any integer is okay :)

Like OgreNewt::CollisionPrimitives::Box(mWorld, Ogre::Vector3(1, 1, 1), 2);

Just make sure other collision shapes aren't using the same ID.

satchigi

24-05-2011 22:52:24

How to see the rigid bodys ouline?

I applied some code to my character and background (I know my code is sucks.)
and it didn't work.

But I just want to check if OgreNewt is properly installed, and can make ridgid body properly by checking ridgid body bounding box's exist.....

following is my code.(please give me some advice)

Ogre::SceneNode* node1 = mSceneMgr->getRootSceneNode()->
createChildSceneNode("player", Ogre::Vector3(0.0f, 0.0f, 0.0f));
Ogre::Entity* entity1 = mSceneMgr->createEntity("player", "DustinBody.mesh");

OgreNewt::CollisionPrimitives::Box* col = new OgreNewt::CollisionPrimitives::Box(mWorld, Ogre::Vector3(10, 10, 10), 0); //You have to pass an int as id in the last parameter
OgreNewt::CollisionPtr colPtr = OgreNewt::CollisionPtr(col);
OgreNewt::Body* mBody = new OgreNewt::Body( mWorld, colPtr );

Ogre::Real mass = 10.0; //Choose a mass here
Ogre::Vector3 inertia, centerOfMass;
col->calculateInertialMatrix(inertia, centerOfMass);
inertia*=mass;
mBody->setMassMatrix( mass, inertia );
mBody->setCenterOfMass(centerOfMass);
mBody->attachNode( node1 );
mBody->setPositionOrientation( Ogre::Vector3(0.0,0.0,0.0), Ogre::Quaternion::IDENTITY );
mBody->setContinuousCollisionMode(true);

Ogre::Entity* entity2 = mSceneMgr->createEntity("background", "back.mesh");
Ogre::SceneNode* node2 = mSceneMgr->getRootSceneNode()->
createChildSceneNode("background", Ogre::Vector3(0.0f, 0.0f, 100.0f));
node2->attachObject(entity2);

OgreNewt::CollisionPrimitives::TreeCollision(mWorld, entity2, false, 2);
OgreNewt::Body* mBody2 = new OgreNewt::Body( mWorld, colPtr );
mBody2->attachNode( node2 );

ologon

25-05-2011 09:57:00

Your code looks fine, but the last part is wrong. You should initialize the treecollision exactly as you did for the Box.

You can find an example in the ogrenewt demos. :wink:

However before playing with tree collision I suggest you to make sure ogre newt is working.
Does you player fall because of gravity?
If not, try mBody->setAutoSleep(false)

satchigi

25-05-2011 12:10:02

Oh, I was attaching the mbody into wrong scenenode. (that was reason not working.)
After I attached proper scenenode, I finally checked Newton is working properly by watching that the character(player) keeps go down through the ground(back).

After I fixed the size of box, it stoped digging the ground and just slip down on gradient littlebit and stop.

I think it's time to study ogreNewton seriously from now.
I appreciate.

but I also want to know how to see the ridged body's bounding box. (for checking the size of ridged body.)
(I heard some guys using this function by pressing F3)

ologon

25-05-2011 13:33:55

I'm happy it finally worked :D

OgreNewt has a debug viewer which should let you see the collision geometry but I can't help you with that, because it didn't work for me :?

I've manually created a box and a sphere that I use as debug geometry

satchigi

25-05-2011 15:36:11

Can you tell me about license thing If you know?

Is OgreNewt and Newton is free for commercial use?

I heard Newton is opensourced from 2.30 version(ZLib), but I don't know it's also applied to older versions.

And what about OgreNewt?

ologon

26-05-2011 08:20:39

Yes, you can use both newton and ogrenewt for commercial purposes.

I'm quite sure the newton zlib license applies to older versions too.

Anyway, even before newton was open sourced you could use it freely so there's no problem I think :wink:

millahjovich

04-07-2016 12:08:29

appreciate. (I tried Newton version 2.16, 2.24)

I'll check right now.

Root13

03-11-2016 13:44:33

There is a guide at the beginning