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.
create_convex_shape ( ) 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.
BLEND_SHAPE_MODE_NORMALIZED = 0 --- Blend shapes are normalized.
BLEND_SHAPE_MODE_RELATIVE = 1 --- Blend shapes are relative to base weight.
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_BONES = 64 --- Mesh array contains bones.
ARRAY_FORMAT_WEIGHTS = 128 --- Mesh array contains bone weights.
ARRAY_FORMAT_INDEX = 256 --- Mesh array uses indices.
ARRAY_COMPRESS_NORMAL = 1024 --- Flag used to mark a compressed (half float) normal array.
ARRAY_COMPRESS_TANGENT = 2048 --- Flag used to mark a compressed (half float) tangent array.
ARRAY_COMPRESS_COLOR = 4096 --- Flag used to mark a compressed (half float) color array.
ARRAY_COMPRESS_TEX_UV = 8192 --- Flag used to mark a compressed (half float) UV coordinates array.
ARRAY_COMPRESS_TEX_UV2 = 16384 --- Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates.
ARRAY_COMPRESS_INDEX = 131072 --- Flag used to mark a compressed index array.
ARRAY_FLAG_USE_2D_VERTICES = 262144 --- Flag used to mark that the array contains 2D vertices.
ARRAY_VERTEX = 0 --- Array of vertices.
ARRAY_NORMAL = 1 --- Array of normals.
ARRAY_TANGENT = 2 --- Array of tangents as an array of floats, 4 floats per tangent.
ARRAY_COLOR = 3 --- Array of colors.
ARRAY_TEX_UV = 4 --- Array of UV coordinates.
ARRAY_TEX_UV2 = 5 --- Array of second set of UV coordinates.
ARRAY_BONES = 6 --- Array of bone data.
ARRAY_WEIGHTS = 7 --- Array of weights.
ARRAY_INDEX = 8 --- Array of indices.
ARRAY_MAX = 9 --- Represents the size of the ArrayType enum.
Sets a hint to be used for lightmap resolution.
Shape create_convex_shape ( ) const
Calculate a ConvexPolygonShape from the mesh.
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).
Shape create_trimesh_shape ( ) const
Calculate a ConcavePolygonShape from the mesh.
TriangleMesh generate_triangle_mesh ( ) const
Generate a TriangleMesh from the mesh.
AABB get_aabb ( ) const
Returns the smallest AABB enclosing this mesh. Not affected by
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.