realtiger
30-11-2006 08:59:33
Hi all
I have just downloaded OgreNewt, and I have some questions that I can't find any appropriate answers. I hope someone here can help me.
First: What is "timestep"?
Is it the period of time the world should be updated from the last update?
If yes, can I use world->update(2) to get the world after 2 seconds?
I have found that there two kinds of framerate: render framerate, desired_framerate used in OgreNewt:BasicFrameListener.
What is the difference between them?
And if m_World->update( m_elapsed ) calculate the world after m_elapsedTime, why we don't use m_World->update( evt.timeSinceLastFrame ) for each frameStarted.
Why do we use this:
Second: What are MaterialID and MaterialPair?
I have found some code which uses MaterialID and MaterialPair to check collision, but I don't actually understand their meaning.
Those are questions I have found now
Any help would be appreciated.
I have just downloaded OgreNewt, and I have some questions that I can't find any appropriate answers. I hope someone here can help me.
First: What is "timestep"?
Is it the period of time the world should be updated from the last update?
If yes, can I use world->update(2) to get the world after 2 seconds?
I have found that there two kinds of framerate: render framerate, desired_framerate used in OgreNewt:BasicFrameListener.
desired_framerate = update_framerate;
m_update = (Ogre::Real)(1.0f / (Ogre::Real)desired_framerate);
What is the difference between them?
And if m_World->update( m_elapsed ) calculate the world after m_elapsedTime, why we don't use m_World->update( evt.timeSinceLastFrame ) for each frameStarted.
Why do we use this:
if ((m_elapsed > m_update) && (m_elapsed < (1.0f)) )
{
while (m_elapsed > m_update)
{
m_World->update( m_update );
m_elapsed -= m_update;
count++;
}
}
else
{
if (m_elapsed < (m_update))
{
// not enough time has passed this loop, so ignore for now.
}
else
{
m_World->update( m_elapsed );
count++;
m_elapsed = 0.0f; // reset the elapsed time so we don't become "eternally behind".
}
}
Second: What are MaterialID and MaterialPair?
I have found some code which uses MaterialID and MaterialPair to check collision, but I don't actually understand their meaning.
Those are questions I have found now
Any help would be appreciated.