Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Mesh¶
Inherits: Resource < RefCounted < Object
Inherited By: ArrayMesh, ImmediateMesh, PlaceholderMesh, PrimitiveMesh
A Resource that contains vertex array-based geometry.
Description¶
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.
Tutorials¶
Properties¶
|
Methods¶
Enumerations¶
enum PrimitiveType:
PrimitiveType PRIMITIVE_POINTS = 0
Render array as points (one vertex equals one point).
PrimitiveType PRIMITIVE_LINES = 1
Render array as lines (every two vertices a line is created).
PrimitiveType PRIMITIVE_LINE_STRIP = 2
Render array as line strip.
PrimitiveType PRIMITIVE_TRIANGLES = 3
Render array as triangles (every three vertices a triangle is created).
PrimitiveType PRIMITIVE_TRIANGLE_STRIP = 4
Render array as triangle strips.
enum ArrayType:
ArrayType ARRAY_VERTEX = 0
PackedVector3Array, PackedVector2Array, or Array of vertex positions.
ArrayType ARRAY_NORMAL = 1
PackedVector3Array of vertex normals.
ArrayType 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.
ArrayType ARRAY_COLOR = 3
PackedColorArray of vertex colors.
ArrayType ARRAY_TEX_UV = 4
PackedVector2Array for UV coordinates.
ArrayType ARRAY_TEX_UV2 = 5
PackedVector2Array for second UV coordinates.
ArrayType ARRAY_CUSTOM0 = 6
Contains custom color channel 0. PackedByteArray if (format >> Mesh.ARRAY_FORMAT_CUSTOM0_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK
is ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RG_HALF or ARRAY_CUSTOM_RGBA_HALF. PackedFloat32Array otherwise.
ArrayType ARRAY_CUSTOM1 = 7
Contains custom color channel 1. PackedByteArray if (format >> Mesh.ARRAY_FORMAT_CUSTOM1_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK
is ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RG_HALF or ARRAY_CUSTOM_RGBA_HALF. PackedFloat32Array otherwise.
ArrayType ARRAY_CUSTOM2 = 8
Contains custom color channel 2. PackedByteArray if (format >> Mesh.ARRAY_FORMAT_CUSTOM2_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK
is ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RG_HALF or ARRAY_CUSTOM_RGBA_HALF. PackedFloat32Array otherwise.
ArrayType ARRAY_CUSTOM3 = 9
Contains custom color channel 3. PackedByteArray if (format >> Mesh.ARRAY_FORMAT_CUSTOM3_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK
is ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RGBA8_UNORM, ARRAY_CUSTOM_RG_HALF or ARRAY_CUSTOM_RGBA_HALF. PackedFloat32Array otherwise.
ArrayType ARRAY_BONES = 10
PackedFloat32Array or PackedInt32Array of bone indices. Contains either 4 or 8 numbers per vertex depending on the presence of the ARRAY_FLAG_USE_8_BONE_WEIGHTS flag.
ArrayType ARRAY_WEIGHTS = 11
PackedFloat32Array or PackedFloat64Array of bone weights in the range 0.0
to 1.0
(inclusive). Contains either 4 or 8 numbers per vertex depending on the presence of the ARRAY_FLAG_USE_8_BONE_WEIGHTS flag.
ArrayType ARRAY_INDEX = 12