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); } }
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; }
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); } }
public void usdiUpdateBounds(ref usdi.SubmeshData data) { usdi.MeshAssignBounds(m_umesh, ref data.center, ref data.extents); }