summaryrefslogtreecommitdiff
path: root/doc/classes/ArrayMesh.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/ArrayMesh.xml')
-rw-r--r--doc/classes/ArrayMesh.xml51
1 files changed, 17 insertions, 34 deletions
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index 1e2478dd14..ed3d2d2205 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -3,6 +3,23 @@
<brief_description>
</brief_description>
<description>
+ The [code]ArrayMesh[/code] is used to construct a [Mesh] by specifying the attributes as arrays. The most basic example is the creation of a single triangle
+ [codeblock]
+ var vertices = PoolVector3Array()
+ vertices.push_back(Vector3(0,1,0))
+ vertices.push_back(Vector3(1,0,0))
+ vertices.push_back(Vector3(0,0,1))
+ # Initialize the ArrayMesh.
+ var arr_mesh = ArrayMesh.new()
+ var arrays = []
+ arrays.resize(ArrayMesh.ARRAY_MAX)
+ arrays[ArrayMesh.ARRAY_VERTEX] = vertices
+ # Create the Mesh.
+ arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
+ var m = MeshInstance.new()
+ m.mesh = arr_mesh
+ [/codeblock]
+ The [code]MeshInstance[/code] is ready to be added to the SceneTree to be shown.
</description>
<tutorials>
</tutorials>
@@ -66,13 +83,6 @@
Returns the name of the blend shape at this index.
</description>
</method>
- <method name="get_surface_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Return the amount of surfaces that the [code]ArrayMesh[/code] holds.
- </description>
- </method>
<method name="lightmap_unwrap">
<return type="int" enum="Error">
</return>
@@ -118,24 +128,6 @@
Return the length in vertices of the vertex array in the requested surface (see [method add_surface_from_arrays]).
</description>
</method>
- <method name="surface_get_arrays" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="surf_idx" type="int">
- </argument>
- <description>
- Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface (see [method add_surface_from_arrays]).
- </description>
- </method>
- <method name="surface_get_blend_shape_arrays" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="surf_idx" type="int">
- </argument>
- <description>
- Returns the blend shape arrays for the requested surface.
- </description>
- </method>
<method name="surface_get_format" qualifiers="const">
<return type="int">
</return>
@@ -145,15 +137,6 @@
Return the format mask of the requested surface (see [method add_surface_from_arrays]).
</description>
</method>
- <method name="surface_get_material" qualifiers="const">
- <return type="Material">
- </return>
- <argument index="0" name="surf_idx" type="int">
- </argument>
- <description>
- Return a [Material] in a given surface. Surface is rendered using this material.
- </description>
- </method>
<method name="surface_get_name" qualifiers="const">
<return type="String">
</return>