2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 01:03:48 +00:00
<class name= "Mesh" inherits= "Resource" version= "4.0" >
2017-09-12 20:42:36 +00:00
<brief_description >
2019-06-21 23:04:47 +00:00
A [Resource] that contains vertex array-based geometry.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2019-06-21 23:04:47 +00:00
Mesh is a type of [Resource] that contains vertex array-based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
2020-10-01 08:34:47 +00:00
<link title= "3D Material Testers Demo" > https://godotengine.org/asset-library/asset/123</link>
<link title= "3D Kinematic Character Demo" > https://godotengine.org/asset-library/asset/126</link>
<link title= "3D Platformer Demo" > https://godotengine.org/asset-library/asset/125</link>
<link title= "Third Person Shooter Demo" > https://godotengine.org/asset-library/asset/678</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
<method name= "create_convex_shape" qualifiers= "const" >
2020-03-30 16:22:57 +00:00
<return type= "Shape3D" >
2017-09-12 20:42:36 +00:00
</return>
<description >
2020-03-30 16:22:57 +00:00
Calculate a [ConvexPolygonShape3D] from the mesh.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "create_outline" qualifiers= "const" >
<return type= "Mesh" >
</return>
<argument index= "0" name= "margin" type= "float" >
</argument>
<description >
2019-06-21 23:04:47 +00:00
Calculate an outline mesh at a defined offset (margin) from the original mesh.
[b]Note:[/b] This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise).
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "create_trimesh_shape" qualifiers= "const" >
2020-03-30 16:22:57 +00:00
<return type= "Shape3D" >
2017-09-12 20:42:36 +00:00
</return>
<description >
2020-03-30 16:22:57 +00:00
Calculate a [ConcavePolygonShape3D] from the mesh.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "generate_triangle_mesh" qualifiers= "const" >
<return type= "TriangleMesh" >
</return>
<description >
Generate a [TriangleMesh] from the mesh.
</description>
</method>
2019-12-08 02:23:05 +00:00
<method name= "get_aabb" qualifiers= "const" >
<return type= "AABB" >
</return>
<description >
2020-09-16 13:53:10 +00:00
Returns the smallest [AABB] enclosing this mesh in local space. Not affected by [code]custom_aabb[/code]. See also [method VisualInstance3D.get_transformed_aabb].
2019-12-08 02:23:05 +00:00
[b]Note:[/b] This is only implemented for [ArrayMesh] and [PrimitiveMesh].
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_faces" qualifiers= "const" >
2020-02-18 12:59:24 +00:00
<return type= "PackedVector3Array" >
2017-09-12 20:42:36 +00:00
</return>
<description >
Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
</description>
</method>
2018-08-29 11:02:48 +00:00
<method name= "get_surface_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2019-05-24 02:15:43 +00:00
Returns the amount of surfaces that the [Mesh] holds.
2018-08-29 11:02:48 +00:00
</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 ArrayMesh.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_material" qualifiers= "const" >
<return type= "Material" >
</return>
<argument index= "0" name= "surf_idx" type= "int" >
</argument>
<description >
2019-05-24 02:15:43 +00:00
Returns a [Material] in a given surface. Surface is rendered using this material.
2018-08-29 11:02:48 +00:00
</description>
</method>
2019-01-31 17:04:36 +00:00
<method name= "surface_set_material" >
<return type= "void" >
</return>
<argument index= "0" name= "surf_idx" type= "int" >
</argument>
<argument index= "1" name= "material" type= "Material" >
</argument>
<description >
2019-06-21 23:04:47 +00:00
Sets a [Material] for a given surface. Surface will be rendered using this material.
2019-01-31 17:04:36 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
</methods>
2017-12-09 23:43:30 +00:00
<members >
2020-05-12 08:10:34 +00:00
<member name= "lightmap_size_hint" type= "Vector2i" setter= "set_lightmap_size_hint" getter= "get_lightmap_size_hint" default= "Vector2i( 0, 0 )" >
2020-02-12 08:59:06 +00:00
Sets a hint to be used for lightmap resolution.
2017-12-09 23:43:30 +00:00
</member>
</members>
2017-09-12 20:42:36 +00:00
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "PRIMITIVE_POINTS" value= "0" enum= "PrimitiveType" >
2017-09-12 20:42:36 +00:00
Render array as points (one vertex equals one point).
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PRIMITIVE_LINES" value= "1" enum= "PrimitiveType" >
2017-09-12 20:42:36 +00:00
Render array as lines (every two vertices a line is created).
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PRIMITIVE_LINE_STRIP" value= "2" enum= "PrimitiveType" >
2017-09-12 20:42:36 +00:00
Render array as line strip.
</constant>
2020-02-12 08:59:06 +00:00
<constant name= "PRIMITIVE_TRIANGLES" value= "3" enum= "PrimitiveType" >
2017-09-12 20:42:36 +00:00
Render array as triangles (every three vertices a triangle is created).
</constant>
2020-02-12 08:59:06 +00:00
<constant name= "PRIMITIVE_TRIANGLE_STRIP" value= "4" enum= "PrimitiveType" >
2017-09-12 20:42:36 +00:00
Render array as triangle strips.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "BLEND_SHAPE_MODE_NORMALIZED" value= "0" enum= "BlendShapeMode" >
2020-01-14 21:27:14 +00:00
Blend shapes are normalized.
2017-09-15 23:46:14 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "BLEND_SHAPE_MODE_RELATIVE" value= "1" enum= "BlendShapeMode" >
2020-01-14 21:27:14 +00:00
Blend shapes are relative to base weight.
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<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>
2017-11-24 22:16:30 +00:00
<constant name= "ARRAY_FORMAT_VERTEX" value= "1" enum= "ArrayFormat" >
2020-01-14 21:27:14 +00:00
Mesh array contains vertices. All meshes require a vertex array so this should always be present.
2017-09-15 23:46:14 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "ARRAY_FORMAT_NORMAL" value= "2" enum= "ArrayFormat" >
2020-01-14 21:27:14 +00:00
Mesh array contains normals.
2017-09-15 23:46:14 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "ARRAY_FORMAT_TANGENT" value= "4" enum= "ArrayFormat" >
2020-01-14 21:27:14 +00:00
Mesh array contains tangents.
2017-09-15 23:46:14 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "ARRAY_FORMAT_COLOR" value= "8" enum= "ArrayFormat" >
2020-01-14 21:27:14 +00:00
Mesh array contains colors.
2017-09-15 23:46:14 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "ARRAY_FORMAT_TEX_UV" value= "16" enum= "ArrayFormat" >
2020-01-14 21:27:14 +00:00
Mesh array contains UVs.
2017-09-15 23:46:14 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "ARRAY_FORMAT_TEX_UV2" value= "32" enum= "ArrayFormat" >
2020-01-14 21:27:14 +00:00
Mesh array contains second UV.
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM0" value= "64" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM1" value= "128" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM2" value= "256" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM3" value= "512" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_BONES" value= "1024" enum= "ArrayFormat" >
Mesh array contains bones.
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_WEIGHTS" value= "2048" enum= "ArrayFormat" >
Mesh array contains bone weights.
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_INDEX" value= "4096" enum= "ArrayFormat" >
Mesh array uses indices.
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_BLEND_SHAPE_MASK" value= "-8185" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM_BASE" value= "13" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM0_SHIFT" value= "13" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM1_SHIFT" value= "16" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM2_SHIFT" value= "19" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM3_SHIFT" value= "22" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FORMAT_CUSTOM_MASK" value= "7" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_COMPRESS_FLAGS_BASE" value= "25" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FLAG_USE_2D_VERTICES" value= "33554432" enum= "ArrayFormat" >
Flag used to mark that the array contains 2D vertices.
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FLAG_USE_DYNAMIC_UPDATE" value= "67108864" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2020-12-04 14:54:48 +00:00
<constant name= "ARRAY_FLAG_USE_8_BONE_WEIGHTS" value= "134217728" enum= "ArrayFormat" >
2017-09-15 23:46:14 +00:00
</constant>
2017-09-12 20:42:36 +00:00
</constants>
</class>