1 /*******************************************************************************
2 * Copyright 2011 See AUTHORS file.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
17 package com.badlogic.gdx.tests.bullet;
19 import com.badlogic.gdx.ApplicationListener;
20 import com.badlogic.gdx.InputProcessor;
21 import com.badlogic.gdx.graphics.Camera;
22 import com.badlogic.gdx.graphics.PerspectiveCamera;
23 import com.badlogic.gdx.input.GestureDetector.GestureListener;
24 import com.badlogic.gdx.math.FloatCounter;
25 import com.badlogic.gdx.math.Vector2;
26 import com.badlogic.gdx.utils.PerformanceCounter;
27 import com.badlogic.gdx.utils.SharedLibraryLoader;
30 public class BulletTest implements ApplicationListener, InputProcessor, GestureListener {
31 public StringBuilder performance = new StringBuilder();
32 public String instructions = "Tap to shoot\nLong press to toggle debug mode\nSwipe for next test\nCtrl+drag to rotate\nScroll to zoom";
33 public PerformanceCounter performanceCounter = new PerformanceCounter(this.getClass().getSimpleName());
34 public FloatCounter fpsCounter = new FloatCounter(5);
35 public PerspectiveCamera camera;
38 public boolean keyDown (int keycode) {
43 public boolean keyTyped (char character) {
48 public boolean keyUp (int keycode) {
53 public boolean touchDown (int screenX, int screenY, int pointer, int button) {
58 public boolean touchUp (int screenX, int screenY, int pointer, int button) {
63 public boolean touchDragged (int screenX, int screenY, int pointer) {
68 public boolean mouseMoved (int screenX, int screenY) {
73 public boolean scrolled (int amount) {
78 public void create () {
82 public void resize (int width, int height) {
86 public void render () {
90 public void pause () {
94 public void resume () {
98 public void dispose () {
102 public boolean touchDown (float x, float y, int pointer, int button) {
107 public boolean tap (float x, float y, int count, int button) {
112 public boolean longPress (float x, float y) {
117 public boolean fling (float velocityX, float velocityY, int button) {
122 public boolean pan (float x, float y, float deltaX, float deltaY) {
127 public boolean zoom (float initialDistance, float distance) {
132 public boolean pinch (Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2) {