예제 #1
0
        public void usdiAllocateMeshData(ref usdi.SubmeshData data)
        {
            // skip if already allocated
            if (m_indices == null || m_indices.Length != data.num_points)
            {
                var sumamry = m_parent.meshSummary;
                m_indices   = new int[data.num_points];
                m_positions = new Vector3[data.num_points];
                if (sumamry.has_normals)
                {
                    m_normals = new Vector3[data.num_points];
                }
                if (sumamry.has_uvs)
                {
                    m_uvs = new Vector2[data.num_points];
                }
            }

            data.points  = usdi.GetArrayPtr(m_positions);
            data.indices = usdi.GetArrayPtr(m_indices);
            if (m_normals != null)
            {
                data.normals = usdi.GetArrayPtr(m_normals);
            }
            if (m_uvs != null)
            {
                data.uvs = usdi.GetArrayPtr(m_uvs);
            }
        }
예제 #2
0
        public void usdiFreeMeshData(ref usdi.SubmeshData data)
        {
            m_positions = null;
            m_normals   = null;
            m_uvs       = null;
            m_indices   = null;

            data.points  = IntPtr.Zero;
            data.normals = IntPtr.Zero;
            data.uvs     = IntPtr.Zero;
            data.indices = IntPtr.Zero;
        }
예제 #3
0
        public void usdiKickVBUpdateTask(ref usdi.SubmeshData data, bool updateIndices)
        {
            bool active = m_renderer.isVisible;

            if (active)
            {
                if (m_vuCmd == null)
                {
                    m_vuCmd = new usdi.VertexUpdateCommand(usdi.usdiPrimGetNameS(m_schema));
                }
                m_vuCmd.Update(ref data, m_VB, updateIndices ? m_IB : IntPtr.Zero);
            }
        }
예제 #4
0
 public void usdiUpdateBounds(ref usdi.SubmeshData data)
 {
     usdi.MeshAssignBounds(m_umesh, ref data.center, ref data.extents);
 }