update and expand surfacetool doc

(cherry picked from commit 84e82a387f)
This commit is contained in:
clayjohn 2018-10-08 21:34:36 -07:00 committed by Rémi Verschelde
parent 0cdcecb813
commit c6f8ceface
1 changed files with 9 additions and 2 deletions

View File

@ -14,6 +14,7 @@
[/codeblock] [/codeblock]
The [code]SurfaceTool[/code] 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. The [code]SurfaceTool[/code] 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. 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.
Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -26,7 +27,7 @@
<argument index="0" name="bones" type="PoolIntArray"> <argument index="0" name="bones" type="PoolIntArray">
</argument> </argument>
<description> <description>
Add an array of bones for the next Vertex to use. Add an array of bones for the next Vertex to use. Array must contain 4 integers.
</description> </description>
</method> </method>
<method name="add_color"> <method name="add_color">
@ -99,6 +100,7 @@
</argument> </argument>
<description> <description>
Insert a triangle fan made of array data into [Mesh] being constructed. Insert a triangle fan made of array data into [Mesh] being constructed.
Requires primitive type be set to [code]PRIMITIVE_TRIANGLES[/code].
</description> </description>
</method> </method>
<method name="add_uv"> <method name="add_uv">
@ -134,7 +136,7 @@
<argument index="0" name="weights" type="PoolRealArray"> <argument index="0" name="weights" type="PoolRealArray">
</argument> </argument>
<description> <description>
Specify weight value for next Vertex to use. Specify weight values for next Vertex to use. Array must contain 4 values.
</description> </description>
</method> </method>
<method name="append_from"> <method name="append_from">
@ -147,6 +149,7 @@
<argument index="2" name="transform" type="Transform"> <argument index="2" name="transform" type="Transform">
</argument> </argument>
<description> <description>
Append vertices from a given [Mesh] surface onto the current vertex array with specified [Transform].
</description> </description>
</method> </method>
<method name="begin"> <method name="begin">
@ -184,6 +187,7 @@
<argument index="1" name="surface" type="int"> <argument index="1" name="surface" type="int">
</argument> </argument>
<description> <description>
Creates a vertex array from an existing [Mesh].
</description> </description>
</method> </method>
<method name="deindex"> <method name="deindex">
@ -198,12 +202,15 @@
</return> </return>
<description> <description>
Generates normals from Vertices so you do not have to do it manually. Generates normals from Vertices so you do not have to do it manually.
Requires primitive type to be set to [code]PRIMITIVE_TRIANGLES[/code].
</description> </description>
</method> </method>
<method name="generate_tangents"> <method name="generate_tangents">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Generates a tangent vector for each vertex.
Requires that each vertex have UVs and normals set already.
</description> </description>
</method> </method>
<method name="index"> <method name="index">