public override void GetLockedVertexIndexBase(out Object vertexbase, out int numverts, out PHY_ScalarType type, out int vertexStride, out Object indexbase, out int indexstride, out int numfaces, out PHY_ScalarType indicestype, int subpart)
        {
            Debug.Assert(subpart < GetNumSubParts());
            IndexedMesh mesh = m_indexedMeshes[subpart];

            numverts     = mesh.m_numVertices;
            vertexbase   = mesh.m_vertexBase;
            type         = mesh.m_vertexType;
            vertexStride = mesh.m_vertexStride;

            numfaces = mesh.m_numTriangles;

            indexbase   = mesh.m_triangleIndexBase;
            indexstride = mesh.m_triangleIndexStride;
            indicestype = mesh.m_indexType;
        }
        public TriangleMesh(bool use32bitIndices, bool use4componentVertices)
        {
            m_use32bitIndices       = use32bitIndices;
            m_use4componentVertices = use4componentVertices;

            IndexedMesh meshIndex = new IndexedMesh();

            m_indexedMeshes.Add(meshIndex);

            if (m_use32bitIndices)
            {
                m_32bitIndices = new ObjectArray <int>();
                m_indexedMeshes[0].m_numTriangles        = m_32bitIndices.Count / 3;
                m_indexedMeshes[0].m_indexType           = PHY_ScalarType.PHY_INTEGER;
                m_indexedMeshes[0].m_triangleIndexStride = 3;
            }
            else
            {
                m_16bitIndices = new ObjectArray <short>();
                m_indexedMeshes[0].m_numTriangles        = m_16bitIndices.Count / 3;
                m_indexedMeshes[0].m_triangleIndexBase   = null;
                m_indexedMeshes[0].m_indexType           = PHY_ScalarType.PHY_SHORT;
                m_indexedMeshes[0].m_triangleIndexStride = 3;
            }

            if (m_use4componentVertices)
            {
                m_4componentVertices              = new ObjectArray <IndexedVector3>();
                m_indexedMeshes[0].m_numVertices  = m_4componentVertices.Count;
                m_indexedMeshes[0].m_vertexStride = 1;
                m_indexedMeshes[0].m_vertexBase   = m_4componentVertices;
            }
            else
            {
                m_3componentVertices              = new ObjectArray <float>();
                m_indexedMeshes[0].m_numVertices  = m_3componentVertices.Count / 3;
                m_indexedMeshes[0].m_vertexStride = 3;
                m_indexedMeshes[0].m_vertexBase   = m_3componentVertices;
            }
        }
 public void AddIndexedMesh(IndexedMesh mesh, PHY_ScalarType indexType)
 {
     m_indexedMeshes.Add(mesh);
     m_indexedMeshes[m_indexedMeshes.Count - 1].m_indexType = indexType;
 }