0 votes

hi,

i have some questions about the SurfaceTool and ArrayMesh:

1) What is the parameter flags intended for:
ArrayMesh commit ( ArrayMesh existing=null, int flags=97280 )

2)
a) Do I understand correctly that every surface in the ArrayMesh has an index and hang behind each other like a train?

b) So the surface tool commit the latest "wagon" on the back of the train, right?

c) And when deleting a surface (int surface_get_format ( int surf_idx ) const) by its index number, each following wagons move forward for 1 wagon/slot?

thx for answering :)

asked Aug 10, 2019 in Engine by player0815 (72 points)

1 Answer

+1 vote
Best answer

1) These flags are combination of options from the Mesh.ARRAY_FORMAT_* enumeration: https://docs.godotengine.org/en/3.1/classes/class_mesh.html#enumerations
Its default value is Mesh.ARRAY_COMPRESS_DEFAULT.
Oddly enough, this isn't documented in SurfaceTool.

2)
a) Yes

b) Yes

c) Yes https://github.com/godotengine/godot/blob/3418f76a9eab9f496e5b26310bd3bc1125b8119b/scene/resources/mesh.cpp#L934

answered Aug 11, 2019 by Zylann (26,157 points)
selected Aug 11, 2019 by player0815
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.