Java 用LIBGDX固定转速
我正在用java和libgdx尝试一些函数 我花了大概1个小时在这上面,我不明白为什么顺时针旋转比逆时针旋转快2倍 如果你看到我遗漏了什么,请帮助我。谢谢大家!Java 用LIBGDX固定转速,java,rotation,libgdx,Java,Rotation,Libgdx,我正在用java和libgdx尝试一些函数 我花了大概1个小时在这上面,我不明白为什么顺时针旋转比逆时针旋转快2倍 如果你看到我遗漏了什么,请帮助我。谢谢大家! game.batch.begin(); game.batch.draw(fond, 0, 0); game.batch.draw(ts, ts.getX(), ts.getY(), ts.getWidth()/2, ts.getHeight()/2, ts.getWidth(), ts.getHeight(), 1, 1
game.batch.begin();
game.batch.draw(fond, 0, 0);
game.batch.draw(ts, ts.getX(), ts.getY(), ts.getWidth()/2, ts.getHeight()/2, ts.getWidth(), ts.getHeight(), 1, 1, rot);
game.batch.end();
if(rot < 1 ) {
hor = Rot.ACLOCKW;
last_changeA = TimeUtils.nanoTime();
System.out.println(TimeUtils.nanoTime() - last_changeC);
}
if(rot > 359) {
hor = Rot.CLOCKW;
last_changeC = TimeUtils.nanoTime();
System.out.println(TimeUtils.nanoTime() - last_changeA);
}
switch(hor) {
case CLOCKW :
rot -= 100*Gdx.graphics.getDeltaTime();
break;
case ACLOCKW :
rot += 100*Gdx.graphics.getDeltaTime();
}
}
game.batch.begin();
游戏。批量。平局(fond,0,0);
game.batch.draw(ts,ts.getX(),ts.getY(),ts.getWidth()/2,ts.getHeight(),ts.getHeight(),1,1,rot);
game.batch.end();
if(rot<1){
hor=Rot.ACLOCKW;
last_changeA=TimeUtils.nanoTime();
System.out.println(TimeUtils.nanoTime()-last_changeC);
}
如果(rot>359){
hor=Rot.CLOCKW;
last_changeC=TimeUtils.nanoTime();
System.out.println(TimeUtils.nanoTime()-last_changeA);
}
开关(hor){
机箱时钟:
rot-=100*Gdx.graphics.getDeltaTime();
打破
案例ACLOCKW:
rot+=100*Gdx.graphics.getDeltaTime();
}
}
我试图在文章开头说“大家好”,但它不想我添加,所以我在这里添加:)。我试图在文章开头说“大家好”,但它不想我添加,所以我在这里添加:)。