implementing OgreNewt

Rivven

23-12-2006 14:23:19

Hello,
I've got several problems implementing OgreNewt into my project, I've been working on it for like 2 weeks now and i'm really stuck on this.
I actually don't know where to start adding it to my code.
All the demo projects are working fine on my system.

Can anyone help me with this problem, I would really apreciate it.
The code i've got so far isn't that big, it's only the problem where to start...
I'll PM my code or just post it here if someone is able to help me.

Thanks in advance

rschlend

23-12-2006 15:26:56

Hi--

I read through this and it helped me.

http://www.ogre3d.org/wiki/index.php/Newton_Game_Dynamics

If this doesn't help, or you get stuck let us know more specifically what the problem/confusion is.

rschlend

Rivven

23-12-2006 16:26:24

Thanks for the quick reply,
I've read the wiki tutorial and I think I understand most of it.
Altough my issue isn't in the problem how things work, but how to implement it in my own project. I have a code with several different classes.
For instance, I have no clue where to put this piece of required code:

OgreNewtonApplication::OgreNewtonApplication(void)
{
// create the OgreNewt world. this must be done before any other commands can be called.
m_World = new OgreNewt::World();

}

OgreNewtonApplication::~OgreNewtonApplication(void)
{
// delete the world when we're done.
delete m_World;

// de-initialize the debugger.
OgreNewt::Debugger::getSingleton().deInit();
}

it all leads to errors like undeclared identifiers.
My main createScene class looks like this:

class GameApplication : public ExampleApplication
{
protected:
public:
GameApplication()
{
}
~GameApplication()
{
}

protected:
void chooseSceneManager(void)
{
mSceneMgr = mRoot->createSceneManager(ST_EXTERIOR_CLOSE);
}

void createScene(void)
{
// Set ambient light
mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));

//ect//

My main goal is to let my character collide with the terrain and every object on it.

Thanks for the help

rschlend

26-12-2006 16:20:09

Hi--

I happen to have my code based off of running a main loop and then calling renderOneFrame, rather than having Ogre "drive" the application through listeners. If you want to do it like this, I would recommend reading:

http://www.ogre3d.org/wiki/index.php/Practical_Application_-_Organization

I used this to help me set up my framework.

I'll assume however that you are intheriting ExampleApplication like


class OgreNewtApplication :
public ExampleApplication


In which case the code you had questons about are the constructor and destructor of the class.

I would also suggest downloading walaber's stunt playground source.
Walaber is the guy who wrote OgreNewt.

http://www.ogre3d.org/phpBB2/viewtopic.php?p=151043

Hope this helps!

rschlend