public void onDrawFrame(GL10 gl) { double time = System.currentTimeMillis(); double elapsed = time - _lastDraw; _lastDraw = time; if (elapsed > 1000) elapsed = 60; elapsed = elapsed / 1000; float pitch = _sensor.getPitch(); float roll = _sensor.getRoll(); for (int i = 0; i < _scene.numChildren(); i++) { Object3d obj = _scene.getChildAt(i); if (obj != _down && obj != _up && obj != _east && obj != _west) { updateObject(obj, elapsed, _sensor.getAccelerometer(), roll, pitch); } } _renderer.onDrawFrame(gl); }
public void onSurfaceCreated(GL10 gl, EGLConfig config) { _renderer.onSurfaceCreated(gl, config); initScene(); }
public void onSurfaceChanged(GL10 gl, int width, int height) { _renderer.onSurfaceChanged(gl, width, height); }