private void WriteSCFData()
        {
            SCFSpecification.SCF SCFFile = new SCFSpecification.SCF();

            WriteSCFMainChunk(SCFFile);

            Geometry geometry = mGeometryLibrary.mGeometries[0];
            Mesh     mesh     = geometry.mMeshes[0];

            for (int i = 0; i < mesh.mTriangles.Count; i++)
            {
                debugOutput += "TriangleGroup " + i + "\n";
                SCFFile.mHeader.mGeometryChunk.mTotalNoOfTriangles += mesh.mTriangles[i].mCount;
            }

            SCFFile.mHeader.mGeometryChunk.mNoOfTriangleGroups = (uint)mesh.mTriangles.Count;

            WriteSCFGeometryChunk(SCFFile);

            WriteSCFArrayData(mesh);

            for (int i = 0; i < SCFFile.mHeader.mGeometryChunk.mNoOfTriangleGroups; i++)
            {
                WriteSCFTrianglesData(mesh.mTriangles[i]);
            }
        }
        private void WriteSCFGeometryChunk(SCFSpecification.SCF scf)
        {
            SCFSpecification.SCFGeometryChunk geometry = scf.mHeader.mGeometryChunk;

            WriteSCF.Write(geometry.mChunkId);
            WriteSCF.Write(geometry.mNoOfTriangleGroups);
            WriteSCF.Write(geometry.mTotalNoOfTriangles);
            WriteSCF.Write(geometry.mDataOffset);
        }
        private void WriteSCFMainChunk(SCFSpecification.SCF scf)
        {
            SCFSpecification.SCFMainChunk main = scf.mHeader.mMainChunk;

            WriteSCF.Write(main.mMagicNumber);
            WriteSCF.Write(main.mVersion);
            WriteSCF.Write(main.mChunkId);
            WriteSCF.Write(main.mNoOfSubChunks);
        }
Beispiel #4
0
        private void WriteSCFData()
        {
            SCFSpecification.SCF SCFFile = new SCFSpecification.SCF();

            WriteSCFMainChunk(SCFFile);

            Geometry geometry = mGeometryLibrary.mGeometries[0];
            Mesh mesh = geometry.mMeshes[0];

            for (int i = 0; i < mesh.mTriangles.Count; i++)
            {
                debugOutput += "TriangleGroup " + i + "\n";
                SCFFile.mHeader.mGeometryChunk.mTotalNoOfTriangles += mesh.mTriangles[i].mCount;
            }

            SCFFile.mHeader.mGeometryChunk.mNoOfTriangleGroups = (uint) mesh.mTriangles.Count;

            WriteSCFGeometryChunk(SCFFile);

            WriteSCFArrayData(mesh);

            for (int i = 0; i < SCFFile.mHeader.mGeometryChunk.mNoOfTriangleGroups; i++)
            {
                WriteSCFTrianglesData(mesh.mTriangles[i]);
            }
        }