osgcatch官方例子代码
switch(ea.getEventType()) case(osgGA::GUIEventAdapter::FRAME): if (_numberOfPlayers>=2) _players[1].moveLeft(); if (_numberOfPlayers>=2) _players[1].moveRight(); static double previous_time = ea.getTime();
double dt = ea.getTime()-previous_time;
previous_time = ea.getTime();
这样dt不等于0了吗?在一帧里啊。难到ea.getTime() 在这里还会变吗 |