Beispiel #1
0
 public void usdiAllocateMeshData(ref usdi.MeshSummary summary, ref usdi.MeshData meshData)
 {
     {
         m_points        = new Vector3[meshData.num_points];
         meshData.points = usdi.GetArrayPtr(m_points);
     }
     {
         m_normals        = new Vector3[meshData.num_points];
         meshData.normals = usdi.GetArrayPtr(m_normals);
     }
     if (summary.has_tangents)
     {
         m_tangents        = new Vector4[meshData.num_points];
         meshData.tangents = usdi.GetArrayPtr(m_tangents);
     }
     if (summary.has_uvs)
     {
         m_uvs        = new Vector2[meshData.num_points];
         meshData.uvs = usdi.GetArrayPtr(m_uvs);
         if (summary.has_tangents)
         {
             m_tangents        = new Vector4[meshData.num_points];
             meshData.tangents = usdi.GetArrayPtr(m_tangents);
         }
     }
     if (summary.num_bones > 0)
     {
         m_weights        = new BoneWeight[meshData.num_points];
         meshData.weights = usdi.GetArrayPtr(m_weights);
     }
     {
         m_indices = new int[meshData.num_indices_triangulated];
         meshData.indices_triangulated = usdi.GetArrayPtr(m_indices);
     }
 }
Beispiel #2
0
        public void usdiAllocateMeshData(ref usdi.MeshSummary summary, ref usdi.SubmeshData[] submeshData)
        {
            var data = submeshData[m_nth];

            {
                m_points    = new Vector3[data.num_points];
                data.points = usdi.GetArrayPtr(m_points);
            }
            {
                m_normals    = new Vector3[data.num_points];
                data.normals = usdi.GetArrayPtr(m_normals);
            }
            if (summary.has_uvs)
            {
                m_uvs    = new Vector2[data.num_points];
                data.uvs = usdi.GetArrayPtr(m_uvs);
                if (summary.has_tangents)
                {
                    m_tangents    = new Vector4[data.num_points];
                    data.tangents = usdi.GetArrayPtr(m_tangents);
                }
            }
            {
                m_indices    = new int[data.num_points];
                data.indices = usdi.GetArrayPtr(m_indices);
            }
            submeshData[m_nth] = data;
        }
Beispiel #3
0
 public void Allocate(ref usdi.MeshSummary summary, ref usdi.MeshData md)
 {
     {
         positions = new Vector3[md.num_points];
         md.points = usdi.GetArrayPtr(positions);
     }
     if (summary.has_normals)
     {
         normals    = new Vector3[md.num_points];
         md.normals = usdi.GetArrayPtr(normals);
     }
     if (summary.has_uvs)
     {
         uvs    = new Vector2[md.num_points];
         md.uvs = usdi.GetArrayPtr(uvs);
     }
     {
         indices = new int[md.num_indices_triangulated];
         md.indices_triangulated = usdi.GetArrayPtr(indices);
     }
 }
Beispiel #4
0
        public override void usdiOnUnload()
        {
            base.usdiOnUnload();

            int c = m_submeshes.Count;

            for (int i = 0; i < c; ++i)
            {
                m_submeshes[i].usdiOnUnload();
            }

            m_meshData    = usdi.MeshData.default_value;
            m_submeshData = null;
            m_meshSummary = usdi.MeshSummary.default_value;

            m_allocateMeshDataRequired = false;
            m_updateIndicesRequired    = false;
            m_updateVerticesRequired   = false;
            m_timeRead = 0.0;

            m_asyncRead = null;
        }