Engines/FlatRedBallXNA/FlatRedBall.Content/ModelAnimation/X File/XMeshImporter.cs
// template MeshNormals
// {
//     DWORD nNormals;
//     array Vector normals[nNormals];
//     DWORD nFaceNormals;
//     array MeshFace faceNormals[nFaceNormals];
// } 
/// <summary>
/// Imports the normals associated with the current mesh.
/// </summary>
Imports the normals associated with the current mesh.
Imports the normals associated with the current mesh .
private void ImportNormals()
            {
                tokens.ReadName();
                hasNormals = true;
                int numNormals = tokens.NextInt();
                if (numNormals == mesh.Positions.Count)
                    normals = new Vector3[numNormals];
                else
                    hasNormals = false;
                for (int i = 0; i < numNormals; i++)
                {
                    Vector3 norm = tokens.NextVector3();
                    if (numNormals == mesh.Positions.Count)
                    {
                        normals[i] = norm;
                        normals[i].Z *= -1;
                    }
                }
                int numFaces = tokens.NextInt();
                for (int i = 0; i < numFaces; i++)
                {
                    int numNormalsPerFace = tokens.NextInt();
                    tokens.SkipTokens(2*numNormalsPerFace+1);
                }
                tokens.SkipToken();
            }
private void ImportNormals ( ) { tokens . ReadName ( ) ; hasNormals = true ; int numNormals = tokens . NextInt ( ) ; if ( numNormals == mesh . Positions . Count ) normals = new Vector3 [ numNormals ] ; else hasNormals = false ; for ( int i = 0 ; i < numNormals ; i ++ ) { Vector3 norm = tokens . NextVector3 ( ) ; if ( numNormals == mesh . Positions . Count ) { normals [ i ] = norm ; normals [ i ] . Z *= - 1 ; } } int numFaces = tokens . NextInt ( ) ; for ( int i = 0 ; i < numFaces ; i ++ ) { int numNormalsPerFace = tokens . NextInt ( ) ; tokens . SkipTokens ( 2 * numNormalsPerFace + 1 ) ; } tokens . SkipToken ( ) ; }
Imports the normals associated with the current mesh.
Imports the normals associated with the current mesh .
// end of mesh normals