2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-08-05 18:51:38 +02:00
<class name= "Mesh" inherits= "Resource" version= "3.6" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 22:42:36 +02:00
<brief_description >
2019-06-22 01:04:47 +02:00
A [Resource] that contains vertex array-based geometry.
2017-09-12 22:42:36 +02:00
</brief_description>
<description >
2019-06-22 01:04:47 +02: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 22:42:36 +02:00
</description>
<tutorials >
2020-10-01 10:34:47 +02: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 22:42:36 +02:00
</tutorials>
<methods >
<method name= "create_convex_shape" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Shape" />
<argument index= "0" name= "clean" type= "bool" default= "true" />
<argument index= "1" name= "simplify" type= "bool" default= "false" />
2017-09-12 22:42:36 +02:00
<description >
Calculate a [ConvexPolygonShape] from the mesh.
2021-07-10 00:31:05 +02:00
If [code]clean[/code] is [code]true[/code] (default), duplicate and interior vertices are removed automatically. You can set it to [code]false[/code] to make the process faster if not needed.
If [code]simplify[/code] is [code]true[/code], the geometry can be further simplified to reduce the amount of vertices. Disabled by default.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "create_outline" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Mesh" />
<argument index= "0" name= "margin" type= "float" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02: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 22:42:36 +02:00
</description>
</method>
<method name= "create_trimesh_shape" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Shape" />
2017-09-12 22:42:36 +02:00
<description >
Calculate a [ConcavePolygonShape] from the mesh.
</description>
</method>
<method name= "generate_triangle_mesh" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "TriangleMesh" />
2017-09-12 22:42:36 +02:00
<description >
2022-05-31 13:50:21 +02:00
Generate a [TriangleMesh] from the mesh. Considers only surfaces using one of these primitive types: [constant PRIMITIVE_TRIANGLES], [constant PRIMITIVE_TRIANGLE_STRIP], or [constant PRIMITIVE_TRIANGLE_FAN].
2017-09-12 22:42:36 +02:00
</description>
</method>
2019-12-08 03:23:05 +01:00
<method name= "get_aabb" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "AABB" />
2019-12-08 03:23:05 +01:00
<description >
2020-09-16 15:53:10 +02:00
Returns the smallest [AABB] enclosing this mesh in local space. Not affected by [code]custom_aabb[/code]. See also [method VisualInstance.get_transformed_aabb].
2019-12-08 03:23:05 +01:00
[b]Note:[/b] This is only implemented for [ArrayMesh] and [PrimitiveMesh].
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_faces" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "PoolVector3Array" />
2017-09-12 22:42:36 +02:00
<description >
Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
</description>
</method>
2018-08-29 13:02:48 +02:00
<method name= "get_surface_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2018-08-29 13:02:48 +02:00
<description >
2019-05-24 04:15:43 +02:00
Returns the amount of surfaces that the [Mesh] holds.
2018-08-29 13:02:48 +02:00
</description>
</method>
<method name= "surface_get_arrays" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Array" />
<argument index= "0" name= "surf_idx" type= "int" />
2018-08-29 13:02:48 +02:00
<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" >
2021-07-30 15:28:05 +02:00
<return type= "Array" />
<argument index= "0" name= "surf_idx" type= "int" />
2018-08-29 13:02:48 +02:00
<description >
Returns the blend shape arrays for the requested surface.
</description>
</method>
<method name= "surface_get_material" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Material" />
<argument index= "0" name= "surf_idx" type= "int" />
2018-08-29 13:02:48 +02:00
<description >
2019-05-24 04:15:43 +02:00
Returns a [Material] in a given surface. Surface is rendered using this material.
2018-08-29 13:02:48 +02:00
</description>
</method>
2019-01-31 18:04:36 +01:00
<method name= "surface_set_material" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "surf_idx" type= "int" />
<argument index= "1" name= "material" type= "Material" />
2019-01-31 18:04:36 +01:00
<description >
2019-06-22 01:04:47 +02:00
Sets a [Material] for a given surface. Surface will be rendered using this material.
2019-01-31 18:04:36 +01:00
</description>
</method>
2017-09-12 22:42:36 +02:00
</methods>
2017-12-10 00:43:30 +01:00
<members >
2019-06-29 12:38:01 +02:00
<member name= "lightmap_size_hint" type= "Vector2" setter= "set_lightmap_size_hint" getter= "get_lightmap_size_hint" default= "Vector2( 0, 0 )" >
2020-12-30 17:12:41 +01:00
Sets a hint to be used for lightmap resolution in [BakedLightmap]. Overrides [member BakedLightmap.default_texels_per_unit].
2017-12-10 00:43:30 +01:00
</member>
</members>
2017-09-12 22:42:36 +02:00
<constants >
2017-11-24 23:16:30 +01:00
<constant name= "PRIMITIVE_POINTS" value= "0" enum= "PrimitiveType" >
2017-09-12 22:42:36 +02:00
Render array as points (one vertex equals one point).
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "PRIMITIVE_LINES" value= "1" enum= "PrimitiveType" >
2017-09-12 22:42:36 +02:00
Render array as lines (every two vertices a line is created).
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "PRIMITIVE_LINE_STRIP" value= "2" enum= "PrimitiveType" >
2017-09-12 22:42:36 +02:00
Render array as line strip.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "PRIMITIVE_LINE_LOOP" value= "3" enum= "PrimitiveType" >
2017-09-12 22:42:36 +02:00
Render array as line loop (like line strip, but closed).
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "PRIMITIVE_TRIANGLES" value= "4" enum= "PrimitiveType" >
2017-09-12 22:42:36 +02:00
Render array as triangles (every three vertices a triangle is created).
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "PRIMITIVE_TRIANGLE_STRIP" value= "5" enum= "PrimitiveType" >
2017-09-12 22:42:36 +02:00
Render array as triangle strips.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "PRIMITIVE_TRIANGLE_FAN" value= "6" enum= "PrimitiveType" >
2017-09-12 22:42:36 +02:00
Render array as triangle fans.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "BLEND_SHAPE_MODE_NORMALIZED" value= "0" enum= "BlendShapeMode" >
2020-01-14 22:27:14 +01:00
Blend shapes are normalized.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "BLEND_SHAPE_MODE_RELATIVE" value= "1" enum= "BlendShapeMode" >
2020-01-14 22:27:14 +01:00
Blend shapes are relative to base weight.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_VERTEX" value= "1" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array contains vertices. All meshes require a vertex array so this should always be present.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_NORMAL" value= "2" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array contains normals.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_TANGENT" value= "4" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array contains tangents.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_COLOR" value= "8" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array contains colors.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_TEX_UV" value= "16" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array contains UVs.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_TEX_UV2" value= "32" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array contains second UV.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_BONES" value= "64" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array contains bones.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_WEIGHTS" value= "128" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array contains bone weights.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FORMAT_INDEX" value= "256" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Mesh array uses indices.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_BASE" value= "9" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Used internally to calculate other [code]ARRAY_COMPRESS_*[/code] enum values. Do not use.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_VERTEX" value= "512" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed (half float) vertex array.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_NORMAL" value= "1024" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed (half float) normal array.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_TANGENT" value= "2048" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed (half float) tangent array.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_COLOR" value= "4096" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed (half float) color array.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_TEX_UV" value= "8192" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed (half float) UV coordinates array.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_TEX_UV2" value= "16384" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_BONES" value= "32768" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed bone array.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_WEIGHTS" value= "65536" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed (half float) weight array.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COMPRESS_INDEX" value= "131072" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark a compressed index array.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FLAG_USE_2D_VERTICES" value= "262144" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark that the array contains 2D vertices.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_FLAG_USE_16_BIT_BONES" value= "524288" enum= "ArrayFormat" >
2020-01-14 22:27:14 +01:00
Flag used to mark that the array uses 16-bit bones instead of 8-bit.
2017-09-16 01:46:14 +02:00
</constant>
2021-03-08 18:58:13 +01:00
<constant name= "ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION" value= "2097152" enum= "ArrayFormat" >
Flag used to mark that the array uses an octahedral representation of normal and tangent vectors rather than cartesian.
</constant>
<constant name= "ARRAY_COMPRESS_DEFAULT" value= "2194432" enum= "ArrayFormat" >
Used to set flags [constant ARRAY_COMPRESS_VERTEX], [constant ARRAY_COMPRESS_NORMAL], [constant ARRAY_COMPRESS_TANGENT], [constant ARRAY_COMPRESS_COLOR], [constant ARRAY_COMPRESS_TEX_UV], [constant ARRAY_COMPRESS_TEX_UV2], [constant ARRAY_COMPRESS_WEIGHTS], and [constant ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION] quickly.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_VERTEX" value= "0" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of vertices.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_NORMAL" value= "1" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of normals.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_TANGENT" value= "2" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of tangents as an array of floats, 4 floats per tangent.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_COLOR" value= "3" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of colors.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_TEX_UV" value= "4" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of UV coordinates.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_TEX_UV2" value= "5" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of second set of UV coordinates.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_BONES" value= "6" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of bone data.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_WEIGHTS" value= "7" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of weights.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_INDEX" value= "8" enum= "ArrayType" >
2018-08-29 13:02:48 +02:00
Array of indices.
2017-09-16 01:46:14 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ARRAY_MAX" value= "9" enum= "ArrayType" >
2019-06-27 11:10:53 +02:00
Represents the size of the [enum ArrayType] enum.
2017-09-16 01:46:14 +02:00
</constant>
2017-09-12 22:42:36 +02:00
</constants>
</class>