Skip to main content

Crate bevy_mesh

Crate bevy_mesh 

Source

Re-exports§

pub use primitives::*;

Modules§

morph
prelude
The mesh prelude.
primitives
Mesh generation for primitive shapes.
skinning

Structs§

BaseMeshPipelineKey
Our base mesh pipeline key bits start from the highest bit and go downward. The PBR mesh pipeline key bits start from the lowest bit and go upward. This allows the PBR bits in the downstream crate bevy_pbr to coexist in the same field without any shifts.
Mesh
A 3D object made out of vertices representing triangles, lines, or points, with “attribute” values for each vertex.
Mesh2d
A component for 2D meshes. Requires a MeshMaterial2d to be rendered, commonly using a ColorMaterial.
Mesh2dTemplate
Mesh3d
A component for 3D meshes. Requires a MeshMaterial3d to be rendered, commonly using a StandardMaterial.
Mesh3dTemplate
MeshAttributeCompressionFlags
If the corresponding attribute compression is enabled:
MeshCompressionArgs
Mesh compression arguments used in Mesh::compressed_mesh.
MeshDeserializer
Use to specify extra options when deserializing a SerializedMesh into a Mesh.
MeshPlugin
Adds Mesh as an asset.
MeshTag
A component that stores an arbitrary index used to identify the mesh instance when rendering.
MeshVertexAttribute
MeshVertexAttributeId
MeshVertexBufferLayout
MeshVertexBufferLayoutRef
Describes the layout of the mesh vertices in GPU memory.
MeshVertexBufferLayouts
Stores the single copy of each mesh vertex buffer layout.
MissingVertexAttributeError
SerializedMesh
A version of Mesh suitable for serializing for short-term transfer.
VertexAttributeDescriptor
VertexBufferLayout
Describes how the vertex buffer is interpreted.

Enums§

AttributeQuantization
Vertex format that can be quantized from Float32.
GenerateTangentsError
Failed to generate tangents for the mesh.
Indices
An array of indices into the VertexAttributeValues for a mesh.
MeshAccessError
Error from accessing mesh vertex attributes or indices
MeshAttributeCompressionError
Error that can occur when compressing/quantizing mesh vertex attributes.
MeshMergeDuplicateVerticesError
Error that can occur when calling Mesh::merge_duplicate_vertices
MeshMergeError
Error that can occur when calling Mesh::merge.
MeshTrianglesError
An error that occurred while trying to extract a collection of triangles from a Mesh.
MeshWindingInvertError
An error that occurred while trying to invert the winding of a Mesh.
PrimitiveTopology
Primitive type the input mesh is composed of.
UvChannel
An enum to define which UV attribute to use for a texture.
VertexAttributeValues
Contains an array where each entry describes a property of a single vertex. Matches the VertexFormats.
VertexFormat
Corresponds to WebGPU GPUVertexFormat.

Constants§

INDEX_BUFFER_ASSET_INDEX
VERTEX_ATTRIBUTE_BUFFER_ID

Functions§

mark_2d_meshes_as_changed_if_their_assets_changed
A system that marks a Mesh2d as changed if the associated Mesh2d asset has changed.
mark_3d_meshes_as_changed_if_their_assets_changed
A system that marks a Mesh3d as changed if the associated Mesh asset has changed.
octahedral_decode_signed
Decode octahedral coordinates to normals or unit direction vectors. Input is [-1, 1].
octahedral_decode_tangent
Decode tangent vectors from octahedral coordinates and return the sign. Input is [-1, 1]. The y component should have been mapped to always be positive and then encoded the sign.
octahedral_encode_signed
Encode normals or unit direction vectors as octahedral coordinates with range [-1, 1]. Use octahedral_decode_signed to decode.
octahedral_encode_tangent
Encode tangent vectors as octahedral coordinates with range [-1, 1]. The sign is encoded in y component. Use octahedral_decode_tangent to decode.
triangle_area_normal
Compute a vector whose direction is the normal of the triangle formed by points a, b, c, and whose magnitude is double the area of the triangle. This is useful for computing smooth normals where the contributing normals are proportionate to the areas of the triangles as discussed here.
triangle_normal
Compute the normal of a face made of three points: a, b, and c.