Updates the model mesh index buffer data. Can be used only for virtual assets (see and ). Mesh data will be cached and uploaded to the GPU with a delay. The mesh index buffer (triangles). Uses 32-bit stride buffer. Cannot be null.
(int[] triangles)
| 24 | /// </summary> |
| 25 | /// <param name="triangles">The mesh index buffer (triangles). Uses 32-bit stride buffer. Cannot be null.</param> |
| 26 | public void UpdateTriangles(int[] triangles) |
| 27 | { |
| 28 | if (!ModelBase.IsVirtual) |
| 29 | throw new InvalidOperationException("Only virtual models can be updated at runtime."); |
| 30 | if (triangles == null) |
| 31 | throw new ArgumentNullException(nameof(triangles)); |
| 32 | if (triangles.Length == 0 || triangles.Length % 3 != 0) |
| 33 | throw new ArgumentOutOfRangeException(nameof(triangles)); |
| 34 | |
| 35 | if (Internal_UpdateTrianglesUInt(__unmanagedPtr, triangles.Length / 3, triangles)) |
| 36 | throw new Exception("Failed to update mesh data."); |
| 37 | } |
| 38 | |
| 39 | /// <summary> |
| 40 | /// Updates the model mesh index buffer data. |
nothing calls this directly
no test coverage detected