Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
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. PackedFl