当前位置: 首页>>代码示例>>Java>>正文


Java ScreenAnnotation.getScreenPoint方法代码示例

本文整理汇总了Java中gov.nasa.worldwind.render.ScreenAnnotation.getScreenPoint方法的典型用法代码示例。如果您正苦于以下问题:Java ScreenAnnotation.getScreenPoint方法的具体用法?Java ScreenAnnotation.getScreenPoint怎么用?Java ScreenAnnotation.getScreenPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nasa.worldwind.render.ScreenAnnotation的用法示例。


在下文中一共展示了ScreenAnnotation.getScreenPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computePanAmount

import gov.nasa.worldwind.render.ScreenAnnotation; //导入方法依赖的package包/类
protected Angle computePanAmount(Globe globe, OrbitView view, ScreenAnnotation control, double panStep)
{
    // Compute last pick point distance relative to pan control center
    double size = control.getAttributes().getSize().width * control.getAttributes().getScale();
    Vec4 center = new Vec4(control.getScreenPoint().x, control.getScreenPoint().y + size / 2, 0);
    double px = lastPickPoint.x - center.x;
    double py = view.getViewport().getHeight() - lastPickPoint.y - center.y;
    double pickDistance = Math.sqrt(px * px + py * py);
    double pickDistanceFactor = Math.min(pickDistance / 10, 5);

    // Compute globe angular distance depending on eye altitude
    Position eyePos = view.getEyePosition();
    double radius = globe.getRadiusAt(eyePos);
    double minValue = 0.5 * (180.0 / (Math.PI * radius)); // Minimum change ~0.5 meters
    double maxValue = 1.0; // Maximum change ~1 degree

    // Compute an interpolated value between minValue and maxValue, using (eye altitude)/(globe radius) as
    // the interpolant. Interpolation is performed on an exponential curve, to keep the value from
    // increasing too quickly as eye altitude increases.
    double a = eyePos.getElevation() / radius;
    a = (a < 0 ? 0 : (a > 1 ? 1 : a));
    double expBase = 2.0; // Exponential curve parameter.
    double value = minValue + (maxValue - minValue) * ((Math.pow(expBase, a) - 1.0) / (expBase - 1.0));

    return Angle.fromDegrees(value * pickDistanceFactor * panStep);
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:27,代码来源:ViewControlsSelectListener.java

示例2: computePanHeading

import gov.nasa.worldwind.render.ScreenAnnotation; //导入方法依赖的package包/类
protected Angle computePanHeading(OrbitView view, ScreenAnnotation control)
{
    // Compute last pick point 'heading' relative to pan control center
    double size = control.getAttributes().getSize().width * control.getAttributes().getScale();
    Vec4 center = new Vec4(control.getScreenPoint().x, control.getScreenPoint().y + size / 2, 0);
    double px = lastPickPoint.x - center.x;
    double py = view.getViewport().getHeight() - lastPickPoint.y - center.y;
    Angle heading = view.getHeading().add(Angle.fromRadians(Math.atan2(px, py)));
    heading = heading.degrees >= 0 ? heading : heading.addDegrees(360);
    return heading;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:12,代码来源:ViewControlsSelectListener.java

示例3: computeLookHeading

import gov.nasa.worldwind.render.ScreenAnnotation; //导入方法依赖的package包/类
protected Angle computeLookHeading(OrbitView view, ScreenAnnotation control, double headingStep)
{
    // Compute last pick point 'heading' relative to look control center on x
    double size = control.getAttributes().getSize().width * control.getAttributes().getScale();
    Vec4 center = new Vec4(control.getScreenPoint().x, control.getScreenPoint().y + size / 2, 0);
    double px = lastPickPoint.x - center.x;
    double pickDistanceFactor = Math.min(Math.abs(px) / 3000, 5) * Math.signum(px);
    // New heading
    Angle heading = view.getHeading().add(Angle.fromRadians(headingStep * pickDistanceFactor));
    heading = heading.degrees >= 0 ? heading : heading.addDegrees(360);
    return heading;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:13,代码来源:ViewControlsSelectListener.java

示例4: computeLookPitch

import gov.nasa.worldwind.render.ScreenAnnotation; //导入方法依赖的package包/类
protected Angle computeLookPitch(OrbitView view, ScreenAnnotation control, double pitchStep)
{
    // Compute last pick point 'pitch' relative to look control center on y
    double size = control.getAttributes().getSize().width * control.getAttributes().getScale();
    Vec4 center = new Vec4(control.getScreenPoint().x, control.getScreenPoint().y + size / 2, 0);
    double py = view.getViewport().getHeight() - lastPickPoint.y - center.y;
    double pickDistanceFactor = Math.min(Math.abs(py) / 3000, 5) * Math.signum(py);
    // New pitch
    Angle pitch = view.getPitch().add(Angle.fromRadians(pitchStep * pickDistanceFactor));
    pitch = pitch.degrees >= 0 ? (pitch.degrees <= 90 ? pitch : Angle.fromDegrees(90)) : Angle.ZERO;
    return pitch;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:13,代码来源:ViewControlsSelectListener.java


注:本文中的gov.nasa.worldwind.render.ScreenAnnotation.getScreenPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。