diff options
author | GaryO <garyo@oberbrunner.com> | 2018-04-22 09:23:33 -0400 |
---|---|---|
committer | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-04-22 15:23:33 +0200 |
commit | 06c5a9ed5f728cff6e6460a67e4b14d3419d41fe (patch) | |
tree | dd864558153283c275a13d0c3dc0da5d1ebcd4d6 /doc/classes | |
parent | d0699b34d7caaac33c1f748e9facc419b32d6dd6 (diff) |
Add detail to doc for add_surface_from_arrays (#17911)
Includes review comments from #17911 from @cbscribe and @Noshyaar
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/ArrayMesh.xml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index c25044b120..38aab5231e 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -29,8 +29,11 @@ <argument index="3" name="compress_flags" type="int" default="97792"> </argument> <description> - Create a new surface ([method get_surface_count] that will become surf_idx for this. - Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. (As a note, when using indices, it is recommended to only use just points, lines or triangles). + Creates a new surface. + Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. See [Mesh] for details. (As a note, when using indices, it is recommended to only use points, lines or triangles). [method get_surface_count] will become the surf_idx for this new surface. + The [code]arrays[/code] argument is an array of arrays. See [enum ArrayType] for the values used in this array. For example, [code]arrays[0][/code] 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 [code]ARRAY_INDEX[/code] 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. + Godot uses clockwise winding order for front faces of triangle primitive modes. </description> </method> <method name="center_geometry"> @@ -232,7 +235,8 @@ Array of bone weights, as a float array. Each element in groups of 4 floats. </constant> <constant name="ARRAY_INDEX" value="8" enum="ArrayType"> - Array of integers, used as indices referencing vertices. No index can be beyond the vertex array size. + [Array] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. + For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line. </constant> <constant name="ARRAY_MAX" value="9" enum="ArrayType"> </constant> |