|
osg::Timer_t prevTime = osg::Timer::instance()->tick();
while (!viewer->done())
{
viewer->frame();
const osg::Timer_t now = osg::Timer::instance()->tick();
double deltaSecs = osg::Timer::instance()->delta_s(prevTime, now);
prevTime = now;
while (deltaSecs > 0.0)
{
if (eh->isForceOn())
{
dBodyAddForce(testBody, 600.0, 0.0, 0.0);
}
dSpaceCollide(Space, 0, nearCallback);
const double step = min(MAX_STEP, deltaSecs);
deltaSecs -= MAX_STEP;
dWorldStep(World, step);
dJointGroupEmpty(ContactGroup);
}
updateOSGWorld();
}
刚开始学习osg,看了以上的例子,有些迷糊,主要是前面关于osg的7行,不是很明白,能否帮忙给注解以下呢?
Thank了! |
|