Engines/FlatRedBallXNA/FlatRedBall.Content/ModelAnimation/X File/XMeshImporter.cs
/// <summary>
/// Adds a channel to the mesh
/// </summary>
/// <typeparam name="T">The structure that stores the channel data</typeparam>
/// <param name="channelName">The type of channel</param>
/// <param name="channelItems">The buffered items to add to the channel</param>
Adds a channel to the mesh
Adds a channel to the mesh
private void AddChannel<T>(string channelName, T[] channelItems)
            {
                foreach (GeometryContent geom in mesh.Geometry)
                {
                    T[] channelData = new T[geom.Vertices.VertexCount];
                    for (int i = 0; i < channelData.Length; i ++)
                        channelData[i] = channelItems[geom.Vertices.PositionIndices[i]];
                    geom.Vertices.Channels.Add<T>(channelName, channelData);
                }
            }
private void AddChannel < T > ( string channelName , T [ ] channelItems ) { foreach ( GeometryContent geom in mesh . Geometry ) { T [ ] channelData = new T [ geom . Vertices . VertexCount ] ; for ( int i = 0 ; i < channelData . Length ; i ++ ) channelData [ i ] = channelItems [ geom . Vertices . PositionIndices [ i ] ] ; geom . Vertices . Channels . Add < T > ( channelName , channelData ) ; } }
Adds a channel to the mesh
Adds a channel to the mesh
channelName
string
The type of channel
The type of channel
channelItems
T[]
The buffered items to add to the channel
The buffered items to add to the channel
typeparam
The structure that stores the channel data
The structure that stores the channel data