本文整理汇总了Java中com.jme3.system.Timer类的典型用法代码示例。如果您正苦于以下问题:Java Timer类的具体用法?Java Timer怎么用?Java Timer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Timer类属于com.jme3.system包,在下文中一共展示了Timer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setTimer
import com.jme3.system.Timer; //导入依赖的package包/类
/**
* Sets the Timer implementation that will be used for calculating
* frame times. By default, Application will use the Timer as returned
* by the current JmeContext implementation.
*/
public void setTimer(Timer timer){
this.timer = timer;
if (timer != null) {
timer.reset();
}
if (renderManager != null) {
renderManager.setTimer(timer);
}
}
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:17,代码来源:Application.java
示例2: update
import com.jme3.system.Timer; //导入依赖的package包/类
@Override
public void update(final float tpf) {
if (!isEnabled()) return;
final Application application = getApplication();
final Timer timer = application.getTimer();
secondCounter += timer.getTimePerFrame();
frameCounter++;
if (secondCounter >= 1.0f) {
fps = (int) (frameCounter / secondCounter);
if (fps != prevFps) {
secondCounter = 0.0f;
frameCounter = 0;
updateFps(fps);
prevFps = fps;
}
}
final int[] statsData = getStatsData();
final Statistics statistics = getStatistics();
statistics.getData(statsData);
final int[] prevStatsData = getPrevStatsData();
if (Arrays.equals(statsData, prevStatsData)) {
return;
}
ArrayUtils.copyTo(statsData, prevStatsData);
final int vertices = statsData[0];
final int triangles = statsData[1];
final int uniforms = statsData[2];
final int objects = statsData[3];
final int shadersS = statsData[4];
final int shadersF = statsData[5];
final int shadersM = statsData[6];
final int texturesS = statsData[7];
final int texturesF = statsData[8];
final int texturesM = statsData[9];
final int frameBuffersS = statsData[10];
final int frameBuffersF = statsData[11];
final int frameBuffersM = statsData[12];
EXECUTOR_MANAGER.addFXTask(() -> {
getVerticesField().setText(Integer.toString(vertices));
getTrianglesField().setText(Integer.toString(triangles));
getUniformsField().setText(Integer.toString(uniforms));
getObjectsField().setText(Integer.toString(objects));
getShadersSField().setText(Integer.toString(shadersS));
getShadersFField().setText(Integer.toString(shadersF));
getShadersMField().setText(Integer.toString(shadersM));
getTexturesSField().setText(Integer.toString(texturesS));
getTexturesFField().setText(Integer.toString(texturesF));
getTexturesMField().setText(Integer.toString(texturesM));
getFrameBuffersSField().setText(Integer.toString(frameBuffersS));
getFrameBuffersFField().setText(Integer.toString(frameBuffersF));
getFrameBuffersMField().setText(Integer.toString(frameBuffersM));
});
}
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:64,代码来源:Stats3DState.java
示例3: getTimer
import com.jme3.system.Timer; //导入依赖的package包/类
public Timer getTimer() {
return timer;
}
开发者ID:mleoking,项目名称:PhET,代码行数:4,代码来源:PhetJMEApplication.java
示例4: getTimer
import com.jme3.system.Timer; //导入依赖的package包/类
@Override
public Timer getTimer() {
defaultFakeError();
return null;
}
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:6,代码来源:FakeApplication.java
示例5: setTimer
import com.jme3.system.Timer; //导入依赖的package包/类
@Override
public void setTimer(Timer timer) {
defaultFakeError();
}
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:5,代码来源:FakeApplication.java
示例6: getTimer
import com.jme3.system.Timer; //导入依赖的package包/类
@Override
public Timer getTimer() {
return innerContext.getTimer();
}
开发者ID:huliqing,项目名称:LuoYing,代码行数:5,代码来源:JfxContext.java
示例7: getTimer
import com.jme3.system.Timer; //导入依赖的package包/类
@Override
public Timer getTimer() {
return timer;
}
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:5,代码来源:GdxContext.java
示例8: getTimer
import com.jme3.system.Timer; //导入依赖的package包/类
@Override
public Timer getTimer()
{
return timer;
}
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:6,代码来源:OGLESContext.java
示例9: setTimer
import com.jme3.system.Timer; //导入依赖的package包/类
/**
* Set the timer that should be used to query the time based
* {@link UniformBinding}s for material world parameters.
*
* @param timer The timer to query time world parameters
*/
public void setTimer(Timer timer) {
this.timer = timer;
}
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:RenderManager.java
注:本文中的com.jme3.system.Timer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论