Skip to content

Commit

Permalink
doc: Sync classref with current source
Browse files Browse the repository at this point in the history
And fixups:
- Add missing bindings in RenderingServer
- Remove duplicate ArrayMesh enum bindings (they're in Mesh already)
- Remove redundant _unhandled_key_input binding in Control (it's in Node
  already)
  • Loading branch information
akien-mga committed Dec 4, 2020
1 parent 3dc8aaa commit 1a001ad
Show file tree
Hide file tree
Showing 20 changed files with 360 additions and 325 deletions.
76 changes: 6 additions & 70 deletions doc/classes/ArrayMesh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# Initialize the ArrayMesh.
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(ArrayMesh.ARRAY_MAX)
arrays[ArrayMesh.ARRAY_VERTEX] = vertices
arrays.resize(Mesh.ARRAY_MAX)
arrays[Mesh.ARRAY_VERTEX] = vertices

# Create the Mesh.
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
Expand All @@ -33,8 +33,8 @@
// Initialize the ArrayMesh.
var arrMesh = new ArrayMesh();
var arrays = new Godot.Collections.Array();
arrays.Resize((int)ArrayMesh.ArrayType.Max);
arrays[(int)ArrayMesh.ArrayType.Vertex] = vertices;
arrays.Resize((int)Mesh.ArrayType.Max);
arrays[(int)Mesh.ArrayType.Vertex] = vertices;

// Create the Mesh.
arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays);
Expand Down Expand Up @@ -71,12 +71,12 @@
<argument index="3" name="lods" type="Dictionary" default="{
}">
</argument>
<argument index="4" name="compress_flags" type="int" default="31744">
<argument index="4" name="compress_flags" type="int" default="0">
</argument>
<description>
Creates a new surface.
Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] 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 [constant ARRAY_INDEX] if it is used.
The [code]arrays[/code] argument is an array of arrays. See [enum Mesh.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 [constant Mesh.ARRAY_INDEX] 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.
</description>
</method>
Expand Down Expand Up @@ -217,69 +217,5 @@
</member>
</members>
<constants>
<constant name="NO_INDEX_ARRAY" value="-1">
Default value used for index_array_len when no indices are present.
</constant>
<constant name="ARRAY_WEIGHTS_SIZE" value="4">
Amount of weights/bone indices per vertex (always 4).
</constant>
<constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
[PackedVector3Array], [PackedVector2Array], or [Array] of vertex positions.
</constant>
<constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
[PackedVector3Array] of vertex normals.
</constant>
<constant name="ARRAY_TANGENT" value="2" enum="ArrayType">
[PackedFloat32Array] of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
</constant>
<constant name="ARRAY_COLOR" value="3" enum="ArrayType">
[PackedColorArray] of vertex colors.
</constant>
<constant name="ARRAY_TEX_UV" value="4" enum="ArrayType">
[PackedVector2Array] for UV coordinates.
</constant>
<constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
[PackedVector2Array] for second UV coordinates.
</constant>
<constant name="ARRAY_BONES" value="6" enum="ArrayType">
[PackedFloat32Array] or [PackedInt32Array] of bone indices. Each element in groups of 4 floats.
</constant>
<constant name="ARRAY_WEIGHTS" value="7" enum="ArrayType">
[PackedFloat32Array] of bone weights. Each element in groups of 4 floats.
</constant>
<constant name="ARRAY_INDEX" value="8" enum="ArrayType">
[PackedInt32Array] 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">
Represents the size of the [enum ArrayType] enum.
</constant>
<constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
Array format will include vertices (mandatory).
</constant>
<constant name="ARRAY_FORMAT_NORMAL" value="2" enum="ArrayFormat">
Array format will include normals.
</constant>
<constant name="ARRAY_FORMAT_TANGENT" value="4" enum="ArrayFormat">
Array format will include tangents.
</constant>
<constant name="ARRAY_FORMAT_COLOR" value="8" enum="ArrayFormat">
Array format will include a color array.
</constant>
<constant name="ARRAY_FORMAT_TEX_UV" value="16" enum="ArrayFormat">
Array format will include UVs.
</constant>
<constant name="ARRAY_FORMAT_TEX_UV2" value="32" enum="ArrayFormat">
Array format will include another set of UVs.
</constant>
<constant name="ARRAY_FORMAT_BONES" value="64" enum="ArrayFormat">
Array format will include bone indices.
</constant>
<constant name="ARRAY_FORMAT_WEIGHTS" value="128" enum="ArrayFormat">
Array format will include bone weights.
</constant>
<constant name="ARRAY_FORMAT_INDEX" value="256" enum="ArrayFormat">
Index array will be used.
</constant>
</constants>
</class>
8 changes: 8 additions & 0 deletions doc/classes/Color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@
<description>
</description>
</method>
<method name="operator -" qualifiers="operator">
<return type="Color">
</return>
<argument index="0" name="right" type="Color">
</argument>
<description>
</description>
</method>
<method name="operator /" qualifiers="operator">
<return type="Color">
</return>
Expand Down
2 changes: 2 additions & 0 deletions doc/classes/LightOccluder2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon">
The [OccluderPolygon2D] used to compute the shadow.
</member>
<member name="sdf_collision" type="bool" setter="set_as_sdf_collision" getter="is_set_as_sdf_collision" default="true">
</member>
</members>
<constants>
</constants>
Expand Down
1 change: 1 addition & 0 deletions doc/classes/LinkButton.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</method>
</methods>
<members>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" />
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
Expand Down
1 change: 1 addition & 0 deletions doc/classes/MenuButton.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<members>
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" override="true" enum="BaseButton.ActionMode" default="0" />
<member name="flat" type="bool" setter="set_flat" getter="is_flat" override="true" default="true" />
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" />
<member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="false">
If [code]true[/code], when the cursor hovers above another [MenuButton] within the same parent which also has [code]switch_on_hover[/code] enabled, it will close the current [MenuButton] and open the other one.
</member>
Expand Down
123 changes: 78 additions & 45 deletions doc/classes/Mesh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,62 @@
<constant name="BLEND_SHAPE_MODE_RELATIVE" value="1" enum="BlendShapeMode">
Blend shapes are relative to base weight.
</constant>
<constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
Array of vertices.
</constant>
<constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
Array of normals.
</constant>
<constant name="ARRAY_TANGENT" value="2" enum="ArrayType">
Array of tangents as an array of floats, 4 floats per tangent.
</constant>
<constant name="ARRAY_COLOR" value="3" enum="ArrayType">
Array of colors.
</constant>
<constant name="ARRAY_TEX_UV" value="4" enum="ArrayType">
Array of UV coordinates.
</constant>
<constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
Array of second set of UV coordinates.
</constant>
<constant name="ARRAY_CUSTOM0" value="6" enum="ArrayType">
</constant>
<constant name="ARRAY_CUSTOM1" value="7" enum="ArrayType">
</constant>
<constant name="ARRAY_CUSTOM2" value="8" enum="ArrayType">
</constant>
<constant name="ARRAY_CUSTOM3" value="9" enum="ArrayType">
</constant>
<constant name="ARRAY_BONES" value="10" enum="ArrayType">
Array of bone data.
</constant>
<constant name="ARRAY_WEIGHTS" value="11" enum="ArrayType">
Array of weights.
</constant>
<constant name="ARRAY_INDEX" value="12" enum="ArrayType">
Array of indices.
</constant>
<constant name="ARRAY_MAX" value="13" enum="ArrayType">
Represents the size of the [enum ArrayType] enum.
</constant>
<constant name="ARRAY_CUSTOM_RGBA8_UNORM" value="0" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_CUSTOM_RGBA8_SNORM" value="1" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_CUSTOM_RG_HALF" value="2" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_CUSTOM_RGBA_HALF" value="3" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_CUSTOM_R_FLOAT" value="4" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_CUSTOM_RG_FLOAT" value="5" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_CUSTOM_RGB_FLOAT" value="6" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_CUSTOM_RGBA_FLOAT" value="7" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_CUSTOM_MAX" value="8" enum="ArrayCustomFormat">
</constant>
<constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
Mesh array contains vertices. All meshes require a vertex array so this should always be present.
</constant>
Expand All @@ -150,68 +206,45 @@
<constant name="ARRAY_FORMAT_TEX_UV2" value="32" enum="ArrayFormat">
Mesh array contains second UV.
</constant>
<constant name="ARRAY_FORMAT_BONES" value="64" enum="ArrayFormat">
Mesh array contains bones.
<constant name="ARRAY_FORMAT_CUSTOM0" value="64" enum="ArrayFormat">
</constant>
<constant name="ARRAY_FORMAT_WEIGHTS" value="128" enum="ArrayFormat">
Mesh array contains bone weights.
<constant name="ARRAY_FORMAT_CUSTOM1" value="128" enum="ArrayFormat">
</constant>
<constant name="ARRAY_FORMAT_INDEX" value="256" enum="ArrayFormat">
Mesh array uses indices.
<constant name="ARRAY_FORMAT_CUSTOM2" value="256" enum="ArrayFormat">
</constant>
<constant name="ARRAY_COMPRESS_NORMAL" value="1024" enum="ArrayFormat">
Flag used to mark a compressed (half float) normal array.
<constant name="ARRAY_FORMAT_CUSTOM3" value="512" enum="ArrayFormat">
</constant>
<constant name="ARRAY_COMPRESS_TANGENT" value="2048" enum="ArrayFormat">
Flag used to mark a compressed (half float) tangent array.
<constant name="ARRAY_FORMAT_BONES" value="1024" enum="ArrayFormat">
Mesh array contains bones.
</constant>
<constant name="ARRAY_COMPRESS_COLOR" value="4096" enum="ArrayFormat">
Flag used to mark a compressed (half float) color array.
<constant name="ARRAY_FORMAT_WEIGHTS" value="2048" enum="ArrayFormat">
Mesh array contains bone weights.
</constant>
<constant name="ARRAY_COMPRESS_TEX_UV" value="8192" enum="ArrayFormat">
Flag used to mark a compressed (half float) UV coordinates array.
<constant name="ARRAY_FORMAT_INDEX" value="4096" enum="ArrayFormat">
Mesh array uses indices.
</constant>
<constant name="ARRAY_COMPRESS_TEX_UV2" value="16384" enum="ArrayFormat">
Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates.
<constant name="ARRAY_FORMAT_BLEND_SHAPE_MASK" value="-8185" enum="ArrayFormat">
</constant>
<constant name="ARRAY_COMPRESS_INDEX" value="131072" enum="ArrayFormat">
Flag used to mark a compressed index array.
<constant name="ARRAY_FORMAT_CUSTOM_BASE" value="13" enum="ArrayFormat">
</constant>
<constant name="ARRAY_FLAG_USE_2D_VERTICES" value="262144" enum="ArrayFormat">
Flag used to mark that the array contains 2D vertices.
<constant name="ARRAY_FORMAT_CUSTOM0_SHIFT" value="13" enum="ArrayFormat">
</constant>
<constant name="ARRAY_COMPRESS_DEFAULT" value="31744" enum="ArrayFormat">
Used to set flags [constant ARRAY_COMPRESS_NORMAL], [constant ARRAY_COMPRESS_TANGENT], [constant ARRAY_COMPRESS_COLOR], [constant ARRAY_COMPRESS_TEX_UV] and [constant ARRAY_COMPRESS_TEX_UV2] quickly.
<constant name="ARRAY_FORMAT_CUSTOM1_SHIFT" value="16" enum="ArrayFormat">
</constant>
<constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
Array of vertices.
<constant name="ARRAY_FORMAT_CUSTOM2_SHIFT" value="19" enum="ArrayFormat">
</constant>
<constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
Array of normals.
<constant name="ARRAY_FORMAT_CUSTOM3_SHIFT" value="22" enum="ArrayFormat">
</constant>
<constant name="ARRAY_TANGENT" value="2" enum="ArrayType">
Array of tangents as an array of floats, 4 floats per tangent.
</constant>
<constant name="ARRAY_COLOR" value="3" enum="ArrayType">
Array of colors.
</constant>
<constant name="ARRAY_TEX_UV" value="4" enum="ArrayType">
Array of UV coordinates.
<constant name="ARRAY_FORMAT_CUSTOM_MASK" value="7" enum="ArrayFormat">
</constant>
<constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
Array of second set of UV coordinates.
</constant>
<constant name="ARRAY_BONES" value="6" enum="ArrayType">
Array of bone data.
<constant name="ARRAY_COMPRESS_FLAGS_BASE" value="25" enum="ArrayFormat">
</constant>
<constant name="ARRAY_WEIGHTS" value="7" enum="ArrayType">
Array of weights.
<constant name="ARRAY_FLAG_USE_2D_VERTICES" value="33554432" enum="ArrayFormat">
Flag used to mark that the array contains 2D vertices.
</constant>
<constant name="ARRAY_INDEX" value="8" enum="ArrayType">
Array of indices.
<constant name="ARRAY_FLAG_USE_DYNAMIC_UPDATE" value="67108864" enum="ArrayFormat">
</constant>
<constant name="ARRAY_MAX" value="9" enum="ArrayType">
Represents the size of the [enum ArrayType] enum.
<constant name="ARRAY_FLAG_USE_8_BONE_WEIGHTS" value="134217728" enum="ArrayFormat">
</constant>
</constants>
</class>
4 changes: 2 additions & 2 deletions doc/classes/MeshDataTool.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@
<return type="int">
</return>
<description>
Returns the [Mesh]'s format. Format is an integer made up of [Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of [code]3[/code] because [constant ArrayMesh.ARRAY_FORMAT_VERTEX] is [code]1[/code] and [constant ArrayMesh.ARRAY_FORMAT_NORMAL] is [code]2[/code].
See [enum ArrayMesh.ArrayFormat] for a list of format flags.
Returns the [Mesh]'s format. Format is an integer made up of [Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of [code]3[/code] because [constant Mesh.ARRAY_FORMAT_VERTEX] is [code]1[/code] and [constant Mesh.ARRAY_FORMAT_NORMAL] is [code]2[/code].
See [enum Mesh.ArrayFormat] for a list of format flags.
</description>
</method>
<method name="get_material" qualifiers="const">
Expand Down
3 changes: 0 additions & 3 deletions doc/classes/PhysicalBone3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@
<member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0">
The body's mass.
</member>
<member name="weight" type="float" setter="set_weight" getter="get_weight" default="9.8">
The body's weight based on its mass and the global 3D gravity. Global values are set in [b]Project &gt; Project Settings &gt; Physics &gt; 3d[/b].
</member>
</members>
<constants>
<constant name="JOINT_TYPE_NONE" value="0" enum="JointType">
Expand Down
4 changes: 4 additions & 0 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,10 @@
</member>
<member name="rendering/quality/2d/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false">
</member>
<member name="rendering/quality/2d_sdf/oversize" type="int" setter="" getter="" default="1">
</member>
<member name="rendering/quality/2d_sdf/scale" type="int" setter="" getter="" default="1">
</member>
<member name="rendering/quality/2d_shadow_atlas/size" type="int" setter="" getter="" default="2048">
</member>
<member name="rendering/quality/depth_of_field/depth_of_field_bokeh_quality" type="int" setter="" getter="" default="2">
Expand Down
8 changes: 8 additions & 0 deletions doc/classes/Quat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@
<description>
</description>
</method>
<method name="operator -" qualifiers="operator">
<return type="Quat">
</return>
<argument index="0" name="right" type="Quat">
</argument>
<description>
</description>
</method>
<method name="operator /" qualifiers="operator">
<return type="Quat">
</return>
Expand Down
Loading

0 comments on commit 1a001ad

Please sign in to comment.