本文整理匯總了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>();
}