public OceanWaterTile(RenderSystem rs, OceanWaterDataManager manager, int @long, int lat) : base(false) { renderSystem = rs; PlanetEarth.TileCoord2CoordNew(@long, lat, out tileCol, out tileLat); material = new Material(rs); FileLocation fl = FileSystem.Instance.Locate("WaterNormal.tex", GameFileLocs.Nature); ResourceHandle <Texture> map = TextureManager.Instance.CreateInstance(fl); material.SetTexture(1, map); fl = FileSystem.Instance.Locate("WaterDudv.tex", GameFileLocs.Nature); map = TextureManager.Instance.CreateInstance(fl); material.SetTexture(0, map); material.SetEffect(EffectManager.Instance.GetModelEffect(WaterEffectFactory.Name)); material.IsTransparent = true; material.ZWriteEnabled = false; material.ZEnabled = true; material.CullMode = CullMode.CounterClockwise; material.PriorityHint = RenderPriority.Third; data0 = manager.GetData(Lod0Size, tileLat); //data1 = manager.GetData(Lod1Size, tileLat); float radtc = MathEx.Degree2Radian(tileCol); float radtl = MathEx.Degree2Radian(tileLat); float rad5 = PlanetEarth.DefaultTileSpan * 0.5f; BoundingSphere.Center = PlanetEarth.GetPosition(radtc + rad5, radtl - rad5); BoundingSphere.Radius = PlanetEarth.GetTileHeight(rad5 * 2); Transformation = Matrix.RotationY(radtc); }
public OceanWater(RenderSystem rs) : base(false) { renderSys = rs; dataMgr = new OceanWaterDataManager(rs); waterTiles = new OceanWaterTile[PlanetEarth.ColTileCount * PlanetEarth.LatTileCount]; for (int i = 1, index = 0; i < PlanetEarth.ColTileCount * 2; i += 2) { for (int j = 1; j < PlanetEarth.LatTileCount * 2; j += 2) { waterTiles[index++] = new OceanWaterTile(rs, dataMgr, i, j + PlanetEarth.LatTileStart); } } //base.ModelL0 = oceanSphere; BoundingSphere.Radius = PlanetEarth.PlanetRadius; }
public OceanWaterTile(RenderSystem rs, OceanWaterDataManager manager, int @long, int lat) : base(false) { renderSystem = rs; PlanetEarth.TileCoord2CoordNew(@long, lat, out tileCol, out tileLat); material = new Material(rs); FileLocation fl = FileSystem.Instance.Locate("WaterNormal.tex", GameFileLocs.Nature); ResourceHandle<Texture> map = TextureManager.Instance.CreateInstance(fl); material.SetTexture(1, map); fl = FileSystem.Instance.Locate("WaterDudv.tex", GameFileLocs.Nature); map = TextureManager.Instance.CreateInstance(fl); material.SetTexture(0, map); material.SetEffect(EffectManager.Instance.GetModelEffect(WaterEffectFactory.Name)); material.IsTransparent = true; material.ZWriteEnabled = false; material.ZEnabled = true; material.CullMode = CullMode.CounterClockwise; material.PriorityHint = RenderPriority.Third; data0 = manager.GetData(Lod0Size, tileLat); //data1 = manager.GetData(Lod1Size, tileLat); float radtc = MathEx.Degree2Radian(tileCol); float radtl = MathEx.Degree2Radian(tileLat); float rad5 = PlanetEarth.DefaultTileSpan * 0.5f; BoundingSphere.Center = PlanetEarth.GetPosition(radtc + rad5, radtl - rad5); BoundingSphere.Radius = PlanetEarth.GetTileHeight(rad5 * 2); Transformation = Matrix.RotationY(radtc); }