本文整理汇总了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));
}
}
示例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);
}
}
示例3: VertexIndexData
public VertexIndexData(VertexPositionNormalTexture[] VertexList, short[] IndexList)
{
this.VertexList = VertexList.ToList<VertexPositionNormalTexture>();
this.IndexList = IndexList.ToList<short>();
}