protected String models[] = new String[] {
"car.obj", "cube.obj", "scene.obj", "scene2.obj", "sphere.obj", "wheel.obj",
- "g3d/head.g3db", "g3d/knight.g3dj", "g3d/knight.g3db", "g3d/teapot.g3db"
+ "g3d/head.g3db", "g3d/knight.g3dj", "g3d/knight.g3db", "g3d/teapot.g3db", "g3d/fighter.g3db"
};
@Override
}
}
+ Vector3 tmpTrans = new Vector3();
+ protected void moveUpDown(int dir) {
+ for (final ModelInstance instance : instances) {
+ instance.transform.getTranslation(tmpTrans);
+
+ instance.transform.setToTranslation(tmpTrans.x, tmpTrans.y + Gdx.graphics.getDeltaTime()*dir, tmpTrans.z );
+ //instance.transform.val[13] += Gdx.graphics.getDeltaTime()*dir;
+ }
+ }
+
@Override
public boolean needsGL20 () {
return true;
public boolean keyUp (int keycode) {
if (keycode == Keys.SPACE || keycode == Keys.MENU)
switchAnimation();
+
+ if (keycode == Keys.S) {
+ moveUpDown(-2);
+ } else if (keycode == Keys.W) {
+ moveUpDown(2);
+ }
return super.keyUp(keycode);
}
}