亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? rectangularnormaltessellator.java

?? world wind java sdk 源碼
?? JAVA
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/*
Copyright (C) 2001, 2009 United States Government
as represented by the Administrator of the
National Aeronautics and Space Administration.
All Rights Reserved.
*/
package gov.nasa.worldwind.examples.sunlight;

import com.sun.opengl.util.BufferUtil;
import gov.nasa.worldwind.*;
import gov.nasa.worldwind.terrain.*;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.cache.*;
import gov.nasa.worldwind.geom.*;
import gov.nasa.worldwind.globes.Globe;
import gov.nasa.worldwind.pick.*;
import gov.nasa.worldwind.render.*;
import gov.nasa.worldwind.util.Logging;

import javax.media.opengl.GL;
import java.awt.*;
import java.nio.*;
import java.util.*;
import java.util.List;

/**
 * @author tag
 * @version $Id: RectangularNormalTessellator.java 10406 2009-04-22 18:28:45Z patrickmurris $
 *
 *          Modified by Michael de Hoog to add simple normals based on globe
 *          ellipse, (globe.computeSurfaceNormalAtPoint()), also added more
 *          exact normal calculator for terrain tiles, see getNormals()
 */
public class RectangularNormalTessellator extends WWObjectImpl implements Tessellator
{
    protected static class RenderInfo
    {
        private final int density;
        private final Vec4 referenceCenter;
        private final DoubleBuffer vertices;
        private final DoubleBuffer normals;
        private final DoubleBuffer texCoords;
        private final IntBuffer indices;
        private final long time;

        private RenderInfo(int density, DoubleBuffer vertices, DoubleBuffer texCoords, DoubleBuffer normals, Vec4 refCenter)
        {
            this.density = density;
            this.vertices = vertices;
            this.texCoords = texCoords;
            this.referenceCenter = refCenter;
            this.indices = getIndices(this.density);
            this.normals = normals;
            this.time = System.currentTimeMillis();
        }

        private long getSizeInBytes()
        {
            // Texture coordinates are shared among all tiles of the same density, so do not count towards size.
            // 8 references, doubles in buffer.
            return 8 * 4 + (this.vertices.limit()) * Double.SIZE;
        }
    }

	public static class RectTile implements SectorGeometry
	{
		private final RectangularNormalTessellator tessellator;
		private final int level;
		private final Sector sector;
		private final int density;
		private final double log10CellSize;
		private Extent extent; // extent of sector in object coordinates
		private RenderInfo ri;

		private int minColorCode = 0;
		private int maxColorCode = 0;

		public RectTile(RectangularNormalTessellator tessellator, Extent extent,
				int level, int density, Sector sector, double cellSize)
		{
			this.tessellator = tessellator;
			this.level = level;
			this.density = density;
			this.sector = sector;
			this.extent = extent;
			this.log10CellSize = Math.log10(cellSize);
		}

		public Sector getSector()
		{
			return this.sector;
		}

		public Extent getExtent()
		{
			return this.extent;
		}

		public void renderMultiTexture(DrawContext dc, int numTextureUnits)
		{
			this.tessellator.renderMultiTexture(dc, this, numTextureUnits);
		}

		public void render(DrawContext dc)
		{
			this.tessellator.render(dc, this);
		}

		public void renderWireframe(DrawContext dc, boolean showTriangles,
				boolean showTileBoundary)
		{
			this.tessellator.renderWireframe(dc, this, showTriangles,
					showTileBoundary);
		}

		public void renderBoundingVolume(DrawContext dc)
		{
			this.tessellator.renderBoundingVolume(dc, this);
		}

		public PickedObject[] pick(DrawContext dc, List<? extends Point> pickPoints)
		{
			return this.tessellator.pick(dc, this, pickPoints);
		}

		public void pick(DrawContext dc, Point pickPoint)
		{
			this.tessellator.pick(dc, this, pickPoint);
		}

		public Vec4 getSurfacePoint(Angle latitude, Angle longitude,
				double metersOffset)
		{
			return this.tessellator.getSurfacePoint(this, latitude, longitude,
					metersOffset);
		}

        public double getResolution()
        {
            return this.sector.getDeltaLatRadians() / this.density;
        }

        public Intersection[] intersect(Line line)
        {
            return this.tessellator.intersect(this, line);
        }

        public Intersection[] intersect(double elevation)
        {
            return this.tessellator.intersect(this,elevation);
        }

        public DoubleBuffer makeTextureCoordinates(GeographicTextureCoordinateComputer computer)
        {
            return this.tessellator.makeGeographicTexCoords(this, computer);
        }

        public ExtractedShapeDescription getIntersectingTessellationPieces(Plane[] p)
        {
            return this.tessellator.getIntersectingTessellationPieces(this,p);
        }

        public ExtractedShapeDescription getIntersectingTessellationPieces(Vec4 Cxyz,
            Vec4 uHat, Vec4 vHat, double uRadius, double vRadius)
        {
            return this.tessellator.getIntersectingTessellationPieces(this,Cxyz,
                uHat,vHat,uRadius,vRadius);
        }
	}

    private static class CacheKey
    {
        private final Sector sector;
        private final int density;
        private final Object globeStateKey;

        public CacheKey(DrawContext dc, Sector sector, int density)
        {
            this.sector = sector;
            this.density = density;
            this.globeStateKey = dc.getGlobe().getStateKey(dc);
        }

        @SuppressWarnings({"EqualsWhichDoesntCheckParameterClass"})
        public boolean equals(Object o)
        {
            if (this == o) return true;

            CacheKey cacheKey = (CacheKey) o; // Note: no check of class type equivalence, for performance

            if (density != cacheKey.density) return false;
            if (globeStateKey != null ? !globeStateKey.equals(cacheKey.globeStateKey) : cacheKey.globeStateKey != null)
                return false;
            //noinspection RedundantIfStatement
            if (sector != null ? !sector.equals(cacheKey.sector) : cacheKey.sector != null) return false;

            return true;
        }

        public int hashCode()
        {
            int result;
            result = (sector != null ? sector.hashCode() : 0);
            result = 31 * result + density;
            result = 31 * result + (globeStateKey != null ? globeStateKey.hashCode() : 0);
            return result;
        }
    }

	// TODO: Make all this configurable
	private static final double DEFAULT_LOG10_RESOLUTION_TARGET = 1.3;
	private static final int DEFAULT_MAX_LEVEL = 12;
	private static final int DEFAULT_NUM_LAT_SUBDIVISIONS = 5;
	private static final int DEFAULT_NUM_LON_SUBDIVISIONS = 10;
	private static final int DEFAULT_DENSITY = 20;
	private static final String CACHE_NAME = "Terrain";
	private static final String CACHE_ID = RectangularNormalTessellator.class.getName();

	// Tri-strip indices and texture coordinates. These depend only on density and can therefore be statically cached.
	private static final HashMap<Integer, DoubleBuffer> parameterizations = new HashMap<Integer, DoubleBuffer>();
	private static final HashMap<Integer, IntBuffer> indexLists = new HashMap<Integer, IntBuffer>();

	private ArrayList<RectTile> topLevels;
	private PickSupport pickSupport = new PickSupport();
	private SectorGeometryList currentTiles = new SectorGeometryList();
	private Frustum currentFrustum;
	private Sector currentCoverage; // union of all tiles selected during call to render()
	private boolean makeTileSkirts = true;
	private int currentLevel;
	private int maxLevel = DEFAULT_MAX_LEVEL;
	private Globe globe;
	private int density = DEFAULT_DENSITY;

    // Lighting
    private Vec4 lightDirection;
    private Material material = new Material(Color.WHITE);
    private Color lightColor = Color.WHITE;
    private Color ambientColor = new Color(.1f, .1f, .1f);

    public SectorGeometryList tessellate(DrawContext dc)
	{
		if (dc == null)
		{
			String msg = Logging.getMessage("nullValue.DrawContextIsNull");
			Logging.logger().severe(msg);
			throw new IllegalArgumentException(msg);
		}

		if (dc.getView() == null)
		{
			String msg = Logging.getMessage("nullValue.ViewIsNull");
			Logging.logger().severe(msg);
			throw new IllegalStateException(msg);
		}

		if (!WorldWind.getMemoryCacheSet().containsCache(CACHE_ID))
		{
			long size = Configuration.getLongValue(
					AVKey.SECTOR_GEOMETRY_CACHE_SIZE, 20000000L);
			MemoryCache cache = new BasicMemoryCache((long) (0.85 * size), size);
			cache.setName(CACHE_NAME);
			WorldWind.getMemoryCacheSet().addCache(CACHE_ID, cache);
		}

		if (this.topLevels == null)
			this.topLevels = this.createTopLevelTiles(dc);

		this.currentTiles.clear();
		this.currentLevel = 0;
		this.currentCoverage = null;

		this.currentFrustum = dc.getView().getFrustumInModelCoordinates();
		for (RectTile tile : this.topLevels)
		{
			this.selectVisibleTiles(dc, tile);
		}

		this.currentTiles.setSector(this.currentCoverage);

		for (SectorGeometry tile : this.currentTiles)
		{
			this.makeVerts(dc, (RectTile) tile);
		}

		return this.currentTiles;
	}

	private ArrayList<RectTile> createTopLevelTiles(DrawContext dc)
	{
		ArrayList<RectTile> tops = new ArrayList<RectTile>(
				DEFAULT_NUM_LAT_SUBDIVISIONS * DEFAULT_NUM_LON_SUBDIVISIONS);

		this.globe = dc.getGlobe();
		double deltaLat = 180d / DEFAULT_NUM_LAT_SUBDIVISIONS;
		double deltaLon = 360d / DEFAULT_NUM_LON_SUBDIVISIONS;
		Angle lastLat = Angle.NEG90;

		for (int row = 0; row < DEFAULT_NUM_LAT_SUBDIVISIONS; row++)
		{
			Angle lat = lastLat.addDegrees(deltaLat);
			if (lat.getDegrees() + 1d > 90d)
				lat = Angle.POS90;

			Angle lastLon = Angle.NEG180;

			for (int col = 0; col < DEFAULT_NUM_LON_SUBDIVISIONS; col++)
			{
				Angle lon = lastLon.addDegrees(deltaLon);
				if (lon.getDegrees() + 1d > 180d)
					lon = Angle.POS180;

				Sector tileSector = new Sector(lastLat, lat, lastLon, lon);
				tops.add(this.createTile(dc, tileSector, 0));
				lastLon = lon;
			}
			lastLat = lat;
		}

		return tops;
	}

	private RectTile createTile(DrawContext dc, Sector tileSector, int level)
	{
		Cylinder cylinder = dc.getGlobe().computeBoundingCylinder(
				dc.getVerticalExaggeration(), tileSector);
		double cellSize = tileSector.getDeltaLatRadians()
				* dc.getGlobe().getRadius() / this.density;

		return new RectTile(this, cylinder, level, this.density, tileSector,
				cellSize);
	}

	public boolean isMakeTileSkirts()
	{
		return makeTileSkirts;
	}

	public void setMakeTileSkirts(boolean makeTileSkirts)
	{
		this.makeTileSkirts = makeTileSkirts;
	}

    public Vec4 getLightDirection()
    {
        return this.lightDirection;
    }

    public void setLightDirection(Vec4 direction)
    {
        this.lightDirection = direction;
    }

    public Color getLightColor()
    {
        return this.lightColor;
    }

    public void setLightColor(Color color)
    {
        if (color == null)
        {
            String msg = Logging.getMessage("nullValue.ColorIsNull");
            Logging.logger().severe(msg);
            throw new IllegalArgumentException(msg);
        }
        this.lightColor = color;
    }

    public Color getAmbientColor()
    {
        return this.ambientColor;
    }

    public void setAmbientColor(Color color)
    {
        if (color == null)
        {
            String msg = Logging.getMessage("nullValue.ColorIsNull");
            Logging.logger().severe(msg);
            throw new IllegalArgumentException(msg);
        }
        this.ambientColor = color;
    }

//	public int getTargetResolution(DrawContext dc, RectTile tile)
//	{
//		return dc.getGlobe().getElevationModel().getTargetResolution(dc, tile.sector, tile.density);
//	}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本福利一区二区| 久久亚洲一区二区三区四区| 91视频一区二区三区| 成人黄色av电影| 99视频在线精品| 99久久久精品| 91麻豆免费视频| 欧美日韩在线一区二区| 欧美日本乱大交xxxxx| 精品视频1区2区| 日韩一区二区三区免费看 | 韩国三级电影一区二区| 久久福利资源站| 国产麻豆欧美日韩一区| 国产精品白丝jk白祙喷水网站 | 久久久综合激的五月天| 国产午夜精品一区二区三区嫩草 | 欧美高清一级片在线| 中文字幕在线不卡一区| 中文字幕中文乱码欧美一区二区| 中文字幕综合网| 午夜精品福利一区二区蜜股av| 石原莉奈在线亚洲二区| 激情欧美一区二区三区在线观看| 成人精品国产免费网站| 欧洲一区二区三区在线| 欧美久久久久久蜜桃| 精品国产百合女同互慰| 国产精品丝袜在线| 亚洲国产美国国产综合一区二区| 免费一级片91| 成人app下载| 欧美精品在线一区二区三区| 精品国精品国产| 国产精品久久久久久久蜜臀| 亚洲午夜激情网站| 另类小说视频一区二区| 99久久亚洲一区二区三区青草| 欧美日韩色综合| 久久久美女毛片| 亚洲一区二区三区三| 久久se这里有精品| 91麻豆国产精品久久| 日韩无一区二区| 亚洲人吸女人奶水| 美女视频网站久久| 91在线一区二区三区| 日韩一级完整毛片| 亚洲图片激情小说| 精品一区二区久久久| 一本色道a无线码一区v| 欧美成人综合网站| 亚洲精品美国一| 国产精品一区一区三区| 欧美亚洲国产一区二区三区 | 亚洲成人手机在线| 国产91在线|亚洲| 正在播放亚洲一区| **欧美大码日韩| 国产精品一区二区果冻传媒| 欧美色图激情小说| 国产精品久久久久久亚洲毛片| 蜜臀av一区二区在线免费观看| 色婷婷综合久久久中文字幕| 久久伊99综合婷婷久久伊| 午夜精品久久久久久不卡8050| 不卡高清视频专区| 日韩一区国产二区欧美三区| 亚洲综合免费观看高清完整版在线 | 欧美激情一区二区三区四区| 美腿丝袜一区二区三区| 欧美主播一区二区三区| 中文字幕亚洲精品在线观看| 极品少妇xxxx精品少妇| 欧美日韩精品一区二区三区四区 | 中文字幕视频一区二区三区久| 久久精品国产亚洲一区二区三区 | 国产精品国模大尺度视频| 久久66热偷产精品| 欧美一区二区三区免费大片| www.66久久| 久久毛片高清国产| 另类的小说在线视频另类成人小视频在线| 91精彩视频在线| 亚洲欧洲韩国日本视频| 国产伦精品一区二区三区视频青涩| 欧美一级专区免费大片| 日本麻豆一区二区三区视频| 欧美视频一二三区| 亚洲综合视频在线观看| 在线观看网站黄不卡| 亚洲精选免费视频| 97久久超碰国产精品电影| 欧美韩国日本不卡| 国产成人精品亚洲午夜麻豆| www日韩大片| 国产在线播放一区二区三区| 精品剧情在线观看| 经典一区二区三区| 欧美不卡在线视频| 国产一区二区视频在线| 欧美精品一区二区三区在线 | 成人久久久精品乱码一区二区三区 | 日韩欧美激情一区| 美女视频免费一区| 欧美一区二区三区免费大片| 日韩国产精品大片| 日韩精品中文字幕一区 | 欧美日韩高清不卡| 日本欧美大码aⅴ在线播放| 日韩你懂的在线播放| 久久激情五月婷婷| 26uuu亚洲综合色欧美| 国产乱人伦偷精品视频免下载| 国产婷婷色一区二区三区| 大陆成人av片| 亚洲精品国产a| 欧美系列一区二区| 日韩vs国产vs欧美| 精品久久久久久最新网址| 国内一区二区在线| 日本一区二区三级电影在线观看 | 日韩欧美区一区二| 国产激情视频一区二区三区欧美| 日本一区二区久久| 91浏览器在线视频| 偷拍自拍另类欧美| 精品日本一线二线三线不卡| 国产成人精品免费网站| 亚洲久草在线视频| 欧美一区二区三区成人| 国产精品一区二区91| 国产精品激情偷乱一区二区∴| 91国内精品野花午夜精品| 蜜桃视频一区二区| 国产精品丝袜在线| 欧美美女直播网站| 国产在线一区二区| 亚洲免费在线播放| 日韩免费高清电影| 成人开心网精品视频| 五月综合激情网| 久久久久久久久久久99999| 91免费在线看| 久久99蜜桃精品| 一区二区中文字幕在线| 欧美猛男男办公室激情| 欧美精品第1页| 丁香婷婷综合网| 亚洲成a人片综合在线| 国产日韩精品一区二区浪潮av| 91美女蜜桃在线| 国内精品国产成人| 亚洲乱码国产乱码精品精的特点| 日韩欧美专区在线| 色婷婷久久综合| 国产一区二区三区四| 亚洲成人中文在线| 中文字幕的久久| 欧美一区二区黄| 91传媒视频在线播放| 极品少妇一区二区三区精品视频 | 免费久久精品视频| 中文字幕乱码久久午夜不卡| 91精品婷婷国产综合久久| 99久久伊人精品| 黑人精品欧美一区二区蜜桃 | 成年人国产精品| 毛片av中文字幕一区二区| 亚洲激情中文1区| 国产欧美日韩视频一区二区| 91精品午夜视频| 欧美中文字幕亚洲一区二区va在线| 国产成人免费高清| 免费日韩伦理电影| 亚洲精品高清在线| 中文字幕在线播放不卡一区| 精品久久久三级丝袜| 在线不卡的av| 欧美色综合网站| 91碰在线视频| 成人动漫一区二区三区| 国产在线国偷精品免费看| 日韩在线一二三区| 亚洲18女电影在线观看| 依依成人综合视频| 国产精品美女久久久久aⅴ| 2020国产精品自拍| 91精品国产乱码久久蜜臀| 欧美午夜精品一区二区三区| 97久久精品人人澡人人爽| 成人免费看视频| 国产98色在线|日韩| 国产高清精品在线| 国产一区二区电影| 国产最新精品精品你懂的| 九九国产精品视频| 美女视频黄a大片欧美| 日本欧洲一区二区| 蜜桃久久久久久久|