penneydude
17-05-2006 03:02:50
I've been using Ogre for a little while now, just making simple little programs to get some experience programming with Ogre, and I decided to try out OgreNewt for my physics. I'm using Gentoo, and it took a little whle to get my program to compile by simply including the OgreNewt headers and declaring a world, but I got it.
The next logical step, I figured, would be to include some code to update the world and stick it in my frame listener, which I did, but I'm now getting these errors:
The code that I put in the frame listener is this:
tehWorld is the world that I declared earlier in the program, and fupdate is just a Real with a value of 1/60, to denote 60 fps. Can anyone help me out? I honestly have no clue what I did wrong.
The next logical step, I figured, would be to include some code to update the world and stick it in my frame listener, which I did, but I'm now getting these errors:
/tmp/cceJpFg2.o(.gnu.linkonce.t._ZN20CSimpleFrameListener12frameStartedERKN4Ogre10FrameEventE+0x725): In function `CSimpleFrameListener::frameStarted(Ogre::FrameEvent const&)':
: undefined reference to `OgreNewt::World::update(float)'
/tmp/cceJpFg2.o(.gnu.linkonce.t._ZN20CSimpleFrameListener12frameStartedERKN4Ogre10FrameEventE+0x762): In function `CSimpleFrameListener::frameStarted(Ogre::FrameEvent const&)':
: undefined reference to `OgreNewt::World::update(float)'
collect2: ld returned 1 exit status
The code that I put in the frame listener is this:
elapsed += evt.timeSinceLastFrame;
if ((elapsed > fupdate) && (elapsed < (1.0f)) )
{
while (elapsed > fupdate)
{
tehWorld->update( fupdate );
elapsed -= fupdate;
}
}
else
{
if (elapsed < (fupdate))
{
// not enough time has passed this loop, so ignore for now.
}
else
{
tehWorld->update( elapsed );
elapsed = 0;
}
}
tehWorld is the world that I declared earlier in the program, and fupdate is just a Real with a value of 1/60, to denote 60 fps. Can anyone help me out? I honestly have no clue what I did wrong.