A Resource that contains vertex array-based geometry.
Mesh is a type of Resource that contains vertex array-based geometry, divided in surfaces. 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.
_get_aabb ( ) virtual const
_get_blend_shape_count ( ) virtual const
_get_surface_count ( ) virtual const
create_trimesh_shape ( ) const
generate_triangle_mesh ( ) const
get_aabb ( ) const
get_faces ( ) const
get_surface_count ( ) const
PRIMITIVE_POINTS = 0 --- Render array as points (one vertex equals one point).
PRIMITIVE_LINES = 1 --- Render array as lines (every two vertices a line is created).
PRIMITIVE_LINE_STRIP = 2 --- Render array as line strip.
PRIMITIVE_TRIANGLES = 3 --- Render array as triangles (every three vertices a triangle is created).
PRIMITIVE_TRIANGLE_STRIP = 4 --- Render array as triangle strips.
ARRAY_NORMAL = 1 --- PackedVector3Array of vertex normals.
ARRAY_TANGENT = 2 --- 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.
ARRAY_COLOR = 3 --- PackedColorArray of vertex colors.
ARRAY_TEX_UV = 4 --- PackedVector2Array for UV coordinates.
ARRAY_TEX_UV2 = 5 --- PackedVector2Array for second UV coordinates.
ARRAY_CUSTOM0 = 6
ARRAY_CUSTOM1 = 7
ARRAY_CUSTOM2 = 8
ARRAY_CUSTOM3 = 9
ARRAY_WEIGHTS = 11 --- PackedFloat32Array of bone weights. Each element in groups of 4 floats.
ARRAY_INDEX = 12 --- 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.
ARRAY_MAX = 13 --- Represents the size of the ArrayType enum.
ARRAY_CUSTOM_RGBA8_UNORM = 0
ARRAY_CUSTOM_RGBA8_SNORM = 1
ARRAY_CUSTOM_RG_HALF = 2
ARRAY_CUSTOM_RGBA_HALF = 3
ARRAY_CUSTOM_R_FLOAT = 4
ARRAY_CUSTOM_RG_FLOAT = 5
ARRAY_CUSTOM_RGB_FLOAT = 6
ARRAY_CUSTOM_RGBA_FLOAT = 7
ARRAY_CUSTOM_MAX = 8 --- Represents the size of the ArrayCustomFormat enum.
ARRAY_FORMAT_VERTEX = 1 --- Mesh array contains vertices. All meshes require a vertex array so this should always be present.
ARRAY_FORMAT_NORMAL = 2 --- Mesh array contains normals.
ARRAY_FORMAT_TANGENT = 4 --- Mesh array contains tangents.
ARRAY_FORMAT_COLOR = 8 --- Mesh array contains colors.
ARRAY_FORMAT_TEX_UV = 16 --- Mesh array contains UVs.
ARRAY_FORMAT_TEX_UV2 = 32 --- Mesh array contains second UV.
ARRAY_FORMAT_CUSTOM0 = 64
ARRAY_FORMAT_CUSTOM1 = 128
ARRAY_FORMAT_CUSTOM2 = 256
ARRAY_FORMAT_CUSTOM3 = 512
ARRAY_FORMAT_BONES = 1024 --- Mesh array contains bones.
ARRAY_FORMAT_WEIGHTS = 2048 --- Mesh array contains bone weights.
ARRAY_FORMAT_INDEX = 4096 --- Mesh array uses indices.
ARRAY_FORMAT_BLEND_SHAPE_MASK = 7
ARRAY_FORMAT_CUSTOM_BASE = 13
ARRAY_FORMAT_CUSTOM_BITS = 3
ARRAY_FORMAT_CUSTOM0_SHIFT = 13
ARRAY_FORMAT_CUSTOM1_SHIFT = 16
ARRAY_FORMAT_CUSTOM2_SHIFT = 19
ARRAY_FORMAT_CUSTOM3_SHIFT = 22
ARRAY_FORMAT_CUSTOM_MASK = 7
ARRAY_COMPRESS_FLAGS_BASE = 25
ARRAY_FLAG_USE_2D_VERTICES = 33554432 --- Flag used to mark that the array contains 2D vertices.
ARRAY_FLAG_USE_DYNAMIC_UPDATE = 67108864
ARRAY_FLAG_USE_8_BONE_WEIGHTS = 134217728
BLEND_SHAPE_MODE_NORMALIZED = 0 --- Blend shapes are normalized.
BLEND_SHAPE_MODE_RELATIVE = 1 --- Blend shapes are relative to base weight.
Sets a hint to be used for lightmap resolution.
AABB _get_aabb ( ) virtual const
int _get_blend_shape_count ( ) virtual const
int _get_surface_count ( ) virtual const
Calculate a ConvexPolygonShape3D from the mesh.
true (default), duplicate and interior vertices are removed automatically. You can set it to
false to make the process faster if not needed.
true, the geometry can be further simplified to reduce the amount of vertices. Disabled by default.
Calculate an outline mesh at a defined offset (margin) from the original mesh.
Note: This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise).
Shape3D create_trimesh_shape ( ) const
Calculate a ConcavePolygonShape3D from the mesh.
TriangleMesh generate_triangle_mesh ( ) const
Generate a TriangleMesh from the mesh.
AABB get_aabb ( ) const
PackedVector3Array get_faces ( ) const
Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
int get_surface_count ( ) const
Returns the amount of surfaces that the
Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface (see ArrayMesh.add_surface_from_arrays).
Returns the blend shape arrays for the requested surface.
Returns a Material in a given surface. Surface is rendered using this material.
Sets a Material for a given surface. Surface will be rendered using this material.