コード例 #1
0
 public LayerTerrainComponent(PlanarTerrain terrain, Format format)
     : base(terrain)
 {
     if (format == null)
         throw new ArgumentNullException("format");
     Format = format;
 }
コード例 #2
0
 public HeightTerrainComponent(PlanarTerrain terrain, Format format)
     : base(terrain, format)
 {
     foreach (PlanarTerrainBlock block in terrain.Blocks)
     {
         block.HeightTexture = Get(block);
     }
 }
コード例 #3
0
 public LayerTerrainComponent(PlanarTerrain terrain, Format format)
     : base(terrain)
 {
     if (format == null)
     {
         throw new ArgumentNullException("format");
     }
     Format = format;
 }
コード例 #4
0
 /// <summary>Initialize the normal layer.</summary>
 /// <param name="terrain"></param>
 public NormalTerrainComponent(PlanarTerrain terrain)
     : base(terrain, Formats.Vector4nb)
 {
     foreach (PlanarTerrainBlock block in terrain.Blocks)
     {
         RecreateNormalMap(block);
         block.NormalTexture = Get(block);
     }
 }
コード例 #5
0
 /// <summary>Initialize the normal layer.</summary>
 /// <param name="terrain"></param>
 public NormalTerrainComponent(PlanarTerrain terrain)
     : base(terrain, Formats.Vector4nb)
 {
     foreach (PlanarTerrainBlock block in terrain.Blocks)
     {
         RecreateNormalMap(block);
         block.NormalTexture = Get(block);
     }
 }
コード例 #6
0
        public TerrainComponent(PlanarTerrain terrain)
        {
            if (terrain == null)
                throw new ArgumentNullException("terrain");
            Terrain = terrain;
            terrain.ComponentsMutable.Add(this);

            if (SupportsNodeLodBlend)
                terrain.ComponentsNodeLodBlend.Add(this);
            if (SupportsNodeClip)
                terrain.ComponentsNodeClip.Add(this);
        }
コード例 #7
0
        internal PlanarTerrainBlock(PlanarTerrain terrain, Vector2i blockIndex)
        {
            this.terrain = terrain;
            this.blockIndex = blockIndex;

            int size = terrain.BlockSize;

            //heightTexture = new Texture2D(device, size, size, true, Format.Single, DepthFormat.None, 0, RenderTargetUsage.PlatformContents);
            //heightBackBuffer = new Texture2D(device, size, size, true, Format.Single, DepthFormat.None, 0, RenderTargetUsage.PlatformContents);

            treeRoot = new TerrainTreeNode(this, new Vector2i(0, 0), size, terrain.DeepestLod);
            DirtyTreeArea = new Box2i(0, 0, size, size);
        }
コード例 #8
0
        /// <summary>Detach the <see cref="TerrainComponent"/> from the <see cref="Terrain"/>.</summary>
        public void Detach()
        {
            if (Terrain != null)
                throw new InvalidOperationException("The module has already been detached from the terrain.");
            Terrain.ComponentsMutable.Remove(this);
            OnDetach();
            if (Detached != null)
                Detached(this, EventArgs.Empty);

            if (SupportsNodeLodBlend)
                Terrain.ComponentsNodeLodBlend.Remove(this);
            if (SupportsNodeClip)
                Terrain.ComponentsNodeClip.Remove(this);

            Terrain = null;
        }
コード例 #9
0
 public DistanceLodTerrainComponent(PlanarTerrain terrain)
     : base(terrain)
 {
 }
コード例 #10
0
 /// <summary>
 /// Initialise the clip module using the given clip function.
 /// </summary>
 /// <param name="terrain">The terrain to add this module to.</param>
 public ClipTerrainComponent(PlanarTerrain terrain)
     : base(terrain)
 {
 }
コード例 #11
0
 public FrustumClipTerrainModule(PlanarTerrain terrain)
     : base(terrain)
 {
     Frustum = new Frustum(Matrix4d.Identity);
 }
コード例 #12
0
 public AttachedTreeTerrainModule(PlanarTerrain terrain) : base(terrain)
 {
 }
コード例 #13
0
 public HeightTerrainComponent(PlanarTerrain terrain, Format format)
     : base(terrain, format)
 {
     foreach (PlanarTerrainBlock block in terrain.Blocks)
         block.HeightTexture = Get(block);
 }
コード例 #14
0
 /// <summary>
 /// Initialise the clip module using the given clip function.
 /// </summary>
 /// <param name="terrain">The terrain to add this module to.</param>
 public ClipTerrainComponent(PlanarTerrain terrain)
     : base(terrain)
 {
 }
コード例 #15
0
 public HeightTerrainComponent(PlanarTerrain terrain) : this(terrain, Formats.Vector1f)
 {
 }
コード例 #16
0
 public GrassTerrainComponent(PlanarTerrain terrain)
     : base(terrain)
 {
 }
コード例 #17
0
 public ColorTerrainComponent(PlanarTerrain terrain, Format format)
     : base(terrain, format)
 {
 }
コード例 #18
0
 public GrassTerrainComponent(PlanarTerrain terrain)
     : base(terrain)
 {
 }
コード例 #19
0
 public HeightTerrainComponent(PlanarTerrain terrain)
     : this(terrain, Formats.Vector1f)
 {
 }
コード例 #20
0
 /// <summary>Initialize the <see cref="OcclusionQueryTerrainComponent"/>.</summary>
 /// <param name="terrain">The <see cref="PlanarTerrain"/> this is to be a <see cref="TerrainComponent"/> for.</param>
 public OcclusionQueryTerrainComponent(PlanarTerrain terrain)
     : base(terrain)
 {
 }
コード例 #21
0
 public DistanceLodTerrainComponent(PlanarTerrain terrain)
     : base(terrain)
 {
 }
コード例 #22
0
 public FrustumClipTerrainModule(PlanarTerrain terrain)
     : base(terrain)
 {
     Frustum = new Frustum(Matrix4d.Identity);
 }
コード例 #23
0
 public ColorTerrainComponent(PlanarTerrain terrain, Format format) : base(terrain, format)
 {
 }