Universe.Physics.BulletSPlugin.BSAPIXNA.DumpRaw C# (CSharp) Method

DumpRaw() public static method

public static DumpRaw ( ObjectArray indices, ObjectArray vertices, int pIndicesCount, int pVerticesCount ) : void
indices ObjectArray
vertices ObjectArray
pIndicesCount int
pVerticesCount int
return void
        public static void DumpRaw(ObjectArray<int> indices, ObjectArray<float> vertices, int pIndicesCount,
            int pVerticesCount)
        {
            String fileName = "objTest3.raw";
            String completePath = System.IO.Path.Combine(Util.configDir(), fileName);
            StreamWriter sw = new StreamWriter(completePath);
            IndexedMesh mesh = new IndexedMesh();

            mesh.m_indexType = PHY_ScalarType.PHY_INTEGER;
            mesh.m_numTriangles = pIndicesCount / 3;
            mesh.m_numVertices = pVerticesCount;
            mesh.m_triangleIndexBase = indices;
            mesh.m_vertexBase = vertices;
            mesh.m_vertexStride = 3;
            mesh.m_vertexType = PHY_ScalarType.PHY_FLOAT;
            mesh.m_triangleIndexStride = 3;

            TriangleIndexVertexArray tribuilder = new TriangleIndexVertexArray();
            tribuilder.AddIndexedMesh(mesh, PHY_ScalarType.PHY_INTEGER);


            try {
                for (int i = 0; i < pVerticesCount; i++) {
                    string s = vertices [indices [i * 3]].ToString ("0.0000");
                    s += " " + vertices [indices [i * 3 + 1]].ToString ("0.0000");
                    s += " " + vertices [indices [i * 3 + 2]].ToString ("0.0000");

                    sw.Write (s + "\n");
                }
            } catch {
            }
            sw.Close();
        }

Same methods

BSAPIXNA::DumpRaw ( int indices, float vertices, int pIndicesCount, int pVerticesCount ) : void
BSAPIXNA