MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / UpdateTriangles

Method UpdateTriangles

Source/Engine/Graphics/Models/MeshBase.cs:26–37  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 1

ExtractArrayFromListMethod · 0.80

Tested by

no test coverage detected