gpt4 book ai didi

gov.nasa.worldwind.WorldWindow.distanceToViewGlobeExtents()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 02:41:05 26 4
gpt4 key购买 nike

本文整理了Java中gov.nasa.worldwind.WorldWindow.distanceToViewGlobeExtents()方法的一些代码示例,展示了WorldWindow.distanceToViewGlobeExtents()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorldWindow.distanceToViewGlobeExtents()方法的具体详情如下:
包路径:gov.nasa.worldwind.WorldWindow
类名称:WorldWindow
方法名:distanceToViewGlobeExtents

WorldWindow.distanceToViewGlobeExtents介绍

[英]Returns the minimum distance from the globe's surface necessary to make the globe's extents visible in this World Window.
[中]返回使地球仪的范围在此世界窗口中可见所需的距离地球仪表面的最小距离。

代码示例

代码示例来源:origin: NASAWorldWind/WorldWindAndroid

protected void applyLimits(LookAt lookAt) {
  double distanceToExtents = this.wwd.distanceToViewGlobeExtents();
  double minRange = 10;
  double maxRange = distanceToExtents * 2;
  lookAt.range = WWMath.clamp(lookAt.range, minRange, maxRange);
  //double minTiltRange = distanceToExtents * 0.1;
  //double maxTiltRange = distanceToExtents * 0.9;
  //double tiltAmount = WWMath.clamp((lookAt.range - minTiltRange) / (maxTiltRange - minTiltRange), 0, 1);
  double maxTilt = 80;
  lookAt.tilt = WWMath.clamp(lookAt.tilt, 0, maxTilt);
}

代码示例来源:origin: NASAWorldWind/WorldWindAndroid

protected void applyLimits(Camera camera) {
    double distanceToExtents = this.wwd.distanceToViewGlobeExtents();
    double minAltitude = 100;
    double maxAltitude = distanceToExtents;
    camera.altitude = WWMath.clamp(camera.altitude, minAltitude, maxAltitude);
    // Limit the tilt to between nadir and the horizon (roughly)
    double r = wwd.getGlobe().getRadiusAt(camera.latitude, camera.latitude);
    double maxTilt = Math.toDegrees(Math.asin(r / (r + camera.altitude)));
    double minTilt = 0;
    camera.tilt = WWMath.clamp(camera.tilt, minTilt, maxTilt);
  }
}

代码示例来源:origin: NASAWorldWind/WorldWindAndroid

/**
 * Prepares this WorldWindow for drawing and event handling.
 *
 * @param configChooser optional argument for choosing an EGL configuration; may be null
 */
protected void init(EGLConfigChooser configChooser) {
  // Initialize the WorldWindow's navigator.
  Location initLocation = Location.fromTimeZone(TimeZone.getDefault());
  double initAltitude = this.distanceToViewGlobeExtents() * 1.1; // add 10% to the minimum distance to allow for space around the screen edges
  this.navigator.setLatitude(initLocation.latitude);
  this.navigator.setLongitude(initLocation.longitude);
  this.navigator.setAltitude(initAltitude);
  // Initialize the WorldWindow's controller.
  this.worldWindowController.setWorldWindow(this);
  // Initialize the WorldWindow's render resource cache.
  int cacheCapacity = RenderResourceCache.recommendedCapacity(this.getContext());
  this.renderResourceCache = new RenderResourceCache(cacheCapacity);
  // Set up to render on demand to an OpenGL ES 2.x context
  // TODO Investigate and use the EGL chooser submitted by jgiovino
  this.setEGLConfigChooser(configChooser);
  this.setEGLContextClientVersion(2); // must be called before setRenderer
  this.setRenderer(this);
  this.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); // must be called after setRenderer
  // Log a message with some basic information about the WorldWindow's configuration.
  Logger.log(Logger.INFO, "WorldWindow initialized");
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com