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


C# VertexPositionNormalTexture.ToList方法代码示例

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


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

示例1: AddData

 public void AddData(VertexPositionNormalTexture[] VertexList, short[] IndexList)
 {
     int _count = this.VertexList.Count;
     this.VertexList.AddRange(VertexList.ToList<VertexPositionNormalTexture>());
     foreach (short index in IndexList)
     {
         this.IndexList.Add((short)(index + _count));
     }
 }
开发者ID:adamgryu,项目名称:HolidayEngine,代码行数:9,代码来源:VertexIndexData.cs

示例2: ComputeShadowMesh

        public void ComputeShadowMesh(Vector3 lightWorldPosition)
        {
            List<VertexBuffer> vertexBuffers;
            List<IndexBuffer> indexBuffers;
            _gameWorld.GetRenderables(out vertexBuffers, out indexBuffers);

            for (int i = 0; i < vertexBuffers.Count; ++i)
            {
                _shadowMeshIndices.Clear();
                _shadowVertices.Clear();
                _shadowIndices.Clear();

                VertexPositionNormalTexture[] vertexData = new VertexPositionNormalTexture[vertexBuffers[i].VertexCount];
                vertexBuffers[i].GetData<VertexPositionNormalTexture>(vertexData);

                UInt32[] vertexIndices = new UInt32[indexBuffers[i].IndexCount];
                indexBuffers[i].GetData<UInt32>(vertexIndices);

                foreach (VertexPositionNormalTexture vertex in vertexData)
                {
                    _shadowVertices.Add(vertex.Position);
                }

                foreach (UInt32 index in vertexIndices)
                {
                    _shadowIndices.Add(index);
                }

                Shadows.CreateShadowVolumeMesh(vertexData.ToList(), _shadowIndices, Vector3.Zero - lightWorldPosition, ref _shadowMeshIndices, ref _shadowMeshVertices);
                IndexBuffer shadowIndexBuffer = new IndexBuffer(GraphicsDevice, IndexElementSize.ThirtyTwoBits, _shadowMeshIndices.Count, BufferUsage.None);
                shadowIndexBuffer.SetData(_shadowMeshIndices.ToArray());
                _shadowIndexList.Add(shadowIndexBuffer);

                List<VertexPositionColor> shadowVertices = new List<VertexPositionColor>();
                foreach(Vector3 vertexPos in _shadowMeshVertices)
                {
                    shadowVertices.Add(new VertexPositionColor(vertexPos, Color.White));
                }

                VertexBuffer shadowVertexBuffer = new VertexBuffer(GraphicsDevice, typeof(VertexPositionColor), shadowVertices.Count, BufferUsage.None);
                shadowVertexBuffer.SetData(shadowVertices.ToArray());
                _shadowVertexBufferList.Add(shadowVertexBuffer);
            }
        }
开发者ID:Fireborn,项目名称:Gamedev,代码行数:44,代码来源:LevelEditor.cs

示例3: VertexIndexData

 public VertexIndexData(VertexPositionNormalTexture[] VertexList, short[] IndexList)
 {
     this.VertexList = VertexList.ToList<VertexPositionNormalTexture>();
     this.IndexList = IndexList.ToList<short>();
 }
开发者ID:adamgryu,项目名称:HolidayEngine,代码行数:5,代码来源:VertexIndexData.cs


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