Click or drag to resize

ArrayMeshAddSurfaceFromArrays Method

Creates a new surface.

Surfaces are created to be rendered using a primitive, which may be any of the types defined in MeshPrimitiveType. (As a note, when using indices, it is recommended to only use points, lines or triangles.) GetSurfaceCount will become the surf_idx for this new surface.

The arrays argument is an array of arrays. See ArrayMeshArrayType for the values used in this array. For example, arrays[0] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for if it is used.

Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public void AddSurfaceFromArrays(
	MeshPrimitiveType primitive,
	Array arrays,
	Array blendShapes = null,
	uint compressFlags = 97280
)

Parameters

primitive
Type: GodotMeshPrimitiveType

[Missing <param name="primitive"/> documentation for "M:Godot.ArrayMesh.AddSurfaceFromArrays(Godot.Mesh.PrimitiveType,Godot.Collections.Array,Godot.Collections.Array,System.UInt32)"]

arrays
Type: Godot.CollectionsArray

[Missing <param name="arrays"/> documentation for "M:Godot.ArrayMesh.AddSurfaceFromArrays(Godot.Mesh.PrimitiveType,Godot.Collections.Array,Godot.Collections.Array,System.UInt32)"]

blendShapes (Optional)
Type: Godot.CollectionsArray
If the parameter is null, then the default value is new Godot.Collections.Array {}
compressFlags (Optional)
Type: SystemUInt32

[Missing <param name="compressFlags"/> documentation for "M:Godot.ArrayMesh.AddSurfaceFromArrays(Godot.Mesh.PrimitiveType,Godot.Collections.Array,Godot.Collections.Array,System.UInt32)"]

See Also