From 478817abadc55a89f8d0ef7aa0341757d5626488 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 25 Apr 2017 20:11:23 -0600 Subject: added documentation for SurfaceTool --- doc/base/classes.xml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'doc/base') diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 766f1877a2..6f6a094927 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -43086,43 +43086,58 @@ Helper tool to create geometry. - Helper tool to create geometry. + The [SurfaceTool] is used to construct a [Mesh] by specifying vertex attributes individually. It can be used to construct a [Mesh] from script. All properties except index need to be added before a call to [method add_vertex]. For example adding vertex colors and UVs looks like + [codeblock] + var st = SurfaceTool.new() + st.begin(Mesh.PRIMITIVE_TRIANGLES) + st.add_color(Color(1, 0, 0)) + st.add_uv(Vector2(0, 0)) + st.add_vertex(Vector3(0, 0, 0)) + [/codeblock] + The [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calls to [method add_uv] or [method add_color] then the last values would be used. + It is very important that vertex attributes are passed [b]before[/b] the call to [method add_vertex], failure to do this will result in an error when committing the vertex information to a mesh. + Add an array of bones for the next Vertex to use. + Specify a [Color] for the next Vertex to use. + Adds an index to index array if you are using indexed Vertices. Does not need to be called before adding Vertex. + Specify a normal for the next Vertex to use. + Specify whether current Vertex (if using only Vertex arrays) or current index (if also using index arrays) should utilize smooth normals for normal calculation. + Specify a Tangent for the next Vertex to use. @@ -43139,40 +43154,47 @@ + Insert a triangle fan made of array data into [Mesh] being constructed. + Specify UV Coordinate for next Vertex to use. + Specify an optional second set of UV coordinates for next Vertex to use. + Specify position of current Vertex. Should be called after specifying other vertex properties (e.g. Color, UV). + Specify weight value for next Vertex to use. + Called before adding any Vertices. Takes the primitive type as an argument (e.g. Mesh.PRIMITIVE_TRIANGLES). + Clear all information passed into the surface tool so far. @@ -43181,24 +43203,29 @@ + Returns a constructed [Mesh] from current information passed in. If an existing [Mesh] is passed in as an argument, will add an extra surface to the existing [Mesh]. + Removes index array by expanding Vertex array. + Generates normals from Vertices so you do not have to do it manually. + Shrinks Vertex array by creating an index array. Avoids reusing Vertices. + Sets [Material] to be used by the [Mesh] you are constructing. -- cgit v1.2.3