本文整理汇总了Java中gov.nasa.worldwind.WorldWind.ABSOLUTE属性的典型用法代码示例。如果您正苦于以下问题:Java WorldWind.ABSOLUTE属性的具体用法?Java WorldWind.ABSOLUTE怎么用?Java WorldWind.ABSOLUTE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类gov.nasa.worldwind.WorldWind
的用法示例。
在下文中一共展示了WorldWind.ABSOLUTE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSliderYPosition
private double getSliderYPosition(final float trackAltitude, final Position eyePosition) {
final TourTrackConfig config = TourTrackConfigManager.getActiveConfig();
double sliderYPosition = 0;
switch (config.altitudeMode) {
case WorldWind.ABSOLUTE:
sliderYPosition = trackAltitude + getAltitudeOffset(eyePosition);
break;
case WorldWind.RELATIVE_TO_GROUND:
sliderYPosition = trackAltitude;
break;
default:
// WorldWind.CLAMP_TO_GROUND -> y position = 0
break;
}
return sliderYPosition;
}
示例2: getAltitudeOffset
/**
* @param eyePosition
* @return Returns altitude offset depending on the configuration settings.
*/
public static double getAltitudeOffset(final Position eyePosition) {
if (eyePosition == null) {
return 0;
}
final TourTrackConfig config = TourTrackConfigManager.getActiveConfig();
final boolean isAbsoluteAltitudeMode = config.altitudeMode == WorldWind.ABSOLUTE;
final boolean isAltitudeOffset = config.isAltitudeOffset;
final boolean isOffsetModeAbsolute =
config.altitudeOffsetMode == TourTrackConfigManager.ALTITUDE_OFFSET_MODE_ABSOLUTE;
final boolean isOffsetModeRelative =
config.altitudeOffsetMode == TourTrackConfigManager.ALTITUDE_OFFSET_MODE_RELATIVE;
final int relativeOffset = config.altitudeOffsetDistanceRelative;
double altitudeOffset = 0;
if (isAbsoluteAltitudeMode && isAltitudeOffset) {
if (isOffsetModeAbsolute) {
altitudeOffset = config.altitudeOffsetDistanceAbsolute;
} else if (isOffsetModeRelative && relativeOffset > 0) {
final double eyeElevation = eyePosition.getElevation();
altitudeOffset = eyeElevation / 100.0 * relativeOffset;
}
if (config.isAltitudeOffsetRandom) {
// this needs to be implemented, is not yet done
}
}
return altitudeOffset;
}
示例3: setSliderPosition
/**
* @param dc
* @return Return slider position or <code>null</code> when it's not fully initialized.
*/
public Position setSliderPosition(final DrawContext dc) {
if (latLon == null) {
// is not fully initialized, this can happen
return null;
}
final TourTrackConfig config = TourTrackConfigManager.getActiveConfig();
float sliderElevation = 0;
switch (config.altitudeMode) {
case WorldWind.ABSOLUTE:
sliderElevation = trackAltitude;
if (config.isAltitudeOffset) {
// append offset
sliderElevation += Map3View.getAltitudeOffset(dc.getView().getEyePosition());
}
break;
case WorldWind.RELATIVE_TO_GROUND:
sliderElevation = trackAltitude;
break;
default:
// WorldWind.CLAMP_TO_GROUND -> y position = 0
break;
}
final Position sliderPosition = new Position(latLon, sliderElevation);
setPosition(sliderPosition);
return sliderPosition;
}