/** * Returns the height of a pixel at a given distance from the eye point. This method assumes the model of a screen * composed of rectangular pixels, where pixel coordinates denote infinitely thin space between pixels. The units of * the returned size are in meters per pixel. * <p/> * The result of this method is undefined if the distance is negative. * * @param distance the distance from the eye point in meters * * @return the pixel height in meters per pixel */ public double pixelSizeAtDistance(double distance) { double tanfovy_2 = Math.tan(Math.toRadians(this.fieldOfView * 0.5)); double frustumHeight = 2 * distance * tanfovy_2; return frustumHeight / this.getHeight(); }
result.y = (float) (this.getHeight() - this.scratchPoint.y); return true;
int py = (int) Math.floor(this.getHeight() - (y + height)); int pw = (int) Math.ceil(width); int ph = (int) Math.ceil(height);
double sy = this.getHeight() - y;
int py = Math.round(this.getHeight() - y); if (!this.viewport.contains(px, py)) { return pickedObjects;
protected void handleTilt(GestureRecognizer recognizer) { int state = recognizer.getState(); float dx = recognizer.getTranslationX(); float dy = recognizer.getTranslationY(); if (state == WorldWind.BEGAN) { this.gestureDidBegin(); this.lastRotation = 0; } else if (state == WorldWind.CHANGED) { // Apply the change in tilt to the navigator, relative to when the gesture began. double headingDegrees = 180 * dx / this.wwd.getWidth(); double tiltDegrees = -180 * dy / this.wwd.getHeight(); this.lookAt.heading = WWMath.normalizeAngle360(this.beginLookAt.heading + headingDegrees); this.lookAt.tilt = this.beginLookAt.tilt + tiltDegrees; this.applyLimits(this.lookAt); this.wwd.getNavigator().setAsLookAt(this.wwd.getGlobe(), this.lookAt); this.wwd.requestRedraw(); } else if (state == WorldWind.ENDED || state == WorldWind.CANCELLED) { this.gestureDidEnd(); } }
@Override protected void handleTilt(GestureRecognizer recognizer) { int state = recognizer.getState(); float dx = recognizer.getTranslationX(); float dy = recognizer.getTranslationY(); if (state == WorldWind.BEGAN) { this.gestureDidBegin(); this.lastRotation = 0; } else if (state == WorldWind.CHANGED) { // Apply the change in tilt to the navigator, relative to when the gesture began. double headingDegrees = 180 * dx / this.wwd.getWidth(); double tiltDegrees = -180 * dy / this.wwd.getHeight(); this.camera.heading = WWMath.normalizeAngle360(this.beginCamera.heading + headingDegrees); this.camera.tilt = this.beginCamera.tilt + tiltDegrees; this.applyLimits(camera); this.wwd.getNavigator().setAsCamera(this.wwd.getGlobe(), this.camera); this.wwd.requestRedraw(); } else if (state == WorldWind.ENDED || state == WorldWind.CANCELLED) { this.gestureDidEnd(); } }