Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::mesh Class Reference

Main class representing a 3D mesh with support for different LODs, submeshes, and skinning. More...

#include <mesh.h>

Classes

struct  adjacent_edge_key
 
struct  armature_node
 
struct  bone_combination_key
 
struct  face_influences
 
struct  info
 
struct  load_data
 Struct used for mesh construction. More...
 
struct  lod_level
 Structure describing a LOD level with its own index buffer and submeshes. More...
 
struct  lod_load_data
 Structure describing a LOD level in load_data (for serialization). More...
 
struct  mesh_submesh_key
 
struct  optimizer_triangle_info
 
struct  optimizer_vertex_info
 
struct  preparation_data
 
struct  submesh
 Structure describing an individual "piece" of the mesh, often grouped by material, but can be any arbitrary collection of triangles. More...
 
struct  triangle
 Structure describing data for a single triangle in the mesh. More...
 
struct  weld_key
 

Public Types

using triangle_array_t = std::vector<triangle>
 
using submesh_array_t = std::vector<submesh*>
 
using bone_palette_array_t = std::vector<bone_palette>
 
using submesh_array_indices_t = std::vector<size_t>
 
using submesh_array_map_t = std::map<uint32_t, submesh_array_indices_t>
 
using data_group_submesh_map_t = std::map<uint32_t, submesh_array_t>
 
using byte_array_t = std::vector<uint8_t>
 

Public Member Functions

 mesh ()
 Constructs a mesh object.
 
 ~mesh ()
 Destructor.
 
void dispose ()
 Clears out all the mesh data.
 
auto get_info () const -> info
 
void bind_render_buffers_for_submesh (const submesh *submesh, uint32_t lod_index=0)
 Binds the mesh data for rendering the selected batch of primitives.
 
auto prepare_mesh (const gfx::vertex_layout &vertex_format) -> bool
 Prepares the mesh with the specified vertex format.
 
auto set_vertex_source (void *source, uint32_t vertex_count, const gfx::vertex_layout &source_format) -> bool
 Sets the source of the vertex buffer to pull data from while preparing the mesh.
 
auto set_vertex_source (byte_array_t &&source, uint32_t vertex_count, const gfx::vertex_layout &source_format) -> bool
 
auto set_bounding_box (const math::bbox &box) -> bool
 
auto set_submeshes (const std::vector< submesh > &submeshes) -> bool
 
auto set_primitives (triangle_array_t &&triangles) -> bool
 Adds primitives (triangles) to the mesh.
 
auto bind_skin (const skin_bind_data &bind_data) -> bool
 Binds the mesh as a skin with the specified skin binding data.
 
auto bind_armature (std::unique_ptr< armature_node > &root) -> bool
 Binds the armature tree.
 
auto load_mesh (load_data &&data) -> bool
 
auto create_plane (const gfx::vertex_layout &format, float width, float height, uint32_t width_segments, uint32_t height_segments, mesh_create_origin origin, bool hardware_copy=true) -> bool
 Creates a plane geometry.
 
auto create_heightfield (const gfx::vertex_layout &format, hpp::span< const float > heights, uint32_t segments_x, uint32_t segments_z, float half_extent_x, float half_extent_z, float height_scale, mesh_create_origin origin, bool hardware_copy=true) -> bool
 Creates a heightfield on the XZ plane (Y up): vertex grid (segments_x+1)*(segments_z+1).
 
auto create_cube (const gfx::vertex_layout &format, float width, float height, float depth, uint32_t width_segments, uint32_t height_segments, uint32_t depth_segments, mesh_create_origin origin, bool hardware_copy=true) -> bool
 Creates a cube geometry.
 
auto create_rounded_cube (const gfx::vertex_layout &format, float width, float height, float depth, uint32_t width_segments, uint32_t height_segments, uint32_t depth_segments, mesh_create_origin origin, bool hardware_copy=true) -> bool
 
auto create_sphere (const gfx::vertex_layout &format, float radius, uint32_t stacks, uint32_t slices, mesh_create_origin origin, bool hardware_copy=true) -> bool
 Creates a sphere geometry.
 
auto create_cylinder (const gfx::vertex_layout &format, float radius, float height, uint32_t stacks, uint32_t slices, mesh_create_origin origin, bool hardware_copy=true) -> bool
 Creates a cylinder geometry.
 
auto create_capsule (const gfx::vertex_layout &format, float radius, float height, uint32_t stacks, uint32_t slices, mesh_create_origin origin, bool hardware_copy=true) -> bool
 Creates a capsule geometry.
 
auto create_cone (const gfx::vertex_layout &format, float radius, float radius_tip, float height, uint32_t stacks, uint32_t slices, mesh_create_origin origin, bool hardware_copy=true) -> bool
 Creates a cone geometry.
 
auto create_torus (const gfx::vertex_layout &format, float outer_radius, float inner_radius, uint32_t bands, uint32_t sides, mesh_create_origin origin, bool hardware_copy=true) -> bool
 Creates a torus geometry.
 
auto create_teapot (const gfx::vertex_layout &format, bool hardware_copy=true) -> bool
 Creates a teapot geometry.
 
auto create_icosahedron (const gfx::vertex_layout &format, bool hardware_copy=true) -> bool
 Creates an icosahedron geometry.
 
auto create_dodecahedron (const gfx::vertex_layout &format, bool hardware_copy=true) -> bool
 Creates a dodecahedron geometry.
 
auto create_icosphere (const gfx::vertex_layout &format, int tesselation_level, bool hardware_copy=true) -> bool
 Creates an icosphere geometry.
 
auto end_prepare (bool hardware_copy=true, bool build_buffers=true, bool weld=false, bool optimize=false) -> bool
 Ends the preparation of the mesh and builds the render data.
 
void build_vb (bool hardware_copy=true)
 Builds the internal vertex buffer.
 
void build_ib (bool hardware_copy=true)
 Builds the internal index buffer.
 
auto generate_adjacency (std::vector< uint32_t > &adjacency) -> bool
 Generates edge-triangle adjacency information for the mesh data.
 
auto get_face_count () const -> uint32_t
 Determines the number of faces stored in the mesh.
 
auto get_vertex_count () const -> uint32_t
 Determines the number of vertices stored in the mesh.
 
auto get_system_vb () -> uint8_t *
 Retrieves the underlying vertex data from the mesh.
 
auto get_system_ib () -> uint32_t *
 Retrieves the underlying index data from the mesh.
 
auto get_vertex_format () const -> const gfx::vertex_layout &
 Retrieves the format of the underlying mesh vertex data.
 
auto get_hardware_vb () const -> std::shared_ptr< gfx::vertex_buffer >
 Retrieves the hardware vertex buffer for the mesh (shared across all LODs).
 
auto get_hardware_ib (uint32_t lod_index=0) const -> std::shared_ptr< gfx::index_buffer >
 Retrieves the hardware index buffer for a given LOD.
 
auto get_skin_bind_data () const -> const skin_bind_data &
 Retrieves the skin bind data if this mesh has been bound as a skin.
 
auto get_bone_palettes () const -> const bone_palette_array_t &
 Retrieves the compiled bone combination palette data if this mesh has been bound as a skin.
 
auto get_armature () const -> const std::unique_ptr< armature_node > &
 Retrieves the armature tree of the mesh.
 
auto get_submesh_node_transforms (uint32_t lod_index=0) const -> std::vector< math::transform >
 Computes the accumulated node transform for each submesh.
 
auto calculate_screen_rect (const math::transform &world, const camera &cam) const -> irect32_t
 Calculates the screen rectangle of the mesh based on its world transform and the camera. This version uses a conservative approach - if any corners are behind the camera, it returns the full viewport as the screen rect. Fast but may overestimate coverage.
 
auto calculate_screen_rect_precise (const math::transform &world, const camera &cam) const -> irect32_t
 Calculates the screen rectangle of the mesh with precise near-plane clipping. This version properly clips edges that cross the near plane for accurate screen coverage. More accurate but slightly more expensive than calculate_screen_rect.
 
auto get_submeshes (uint32_t lod_index=0) const -> const submesh_array_t &
 Retrieves information about the submesh of the mesh associated with the specified data group identifier.
 
auto get_submesh (uint32_t submesh_index=0, uint32_t lod_index=0) const -> const submesh *
 
auto get_bounds () const -> const math::bbox &
 Gets the local bounding box for this mesh.
 
auto get_status () const -> mesh_status
 Gets the preparation status for this mesh.
 
auto get_data_groups_count () const -> size_t
 Gets the number of data groups(materials) for this mesh.
 
auto get_default_material_uids () const -> const std::vector< hpp::uuid > &
 Gets the default material UIDs generated during import.
 
auto get_imported_materials () const -> std::vector< asset_handle< material > >
 Gets the imported materials generated during import.
 
auto get_submeshes_count (uint32_t lod_index=0) const -> size_t
 Gets the number of submeshes for this mesh.
 
auto find_submesh_index_by_stable_id (uint32_t stable_id, uint32_t lod_index=0) const -> int
 Finds the submesh array index matching an import-stable submesh identifier.
 
auto get_skinned_submeshes_count (uint32_t lod_index=0) const -> size_t
 Gets the number of skinned submeshes for this mesh.
 
auto get_skinned_submeshes_indices (uint32_t data_group_id, uint32_t lod_index=0) const -> const submesh_array_indices_t &
 Gets the indices of skinned submeshes for a specific data group.
 
auto get_non_skinned_submeshes_count (uint32_t lod_index=0) const -> size_t
 Gets the number of non-skinned submeshes for this mesh.
 
auto get_non_skinned_submeshes_indices (uint32_t data_group_id, uint32_t lod_index=0) const -> const submesh_array_indices_t &
 Gets the indices of non-skinned submeshes for a specific data group.
 
auto get_submesh_index (const submesh *s, uint32_t lod_index=0) const -> int
 Gets the index of a submesh within the submesh array.
 
auto get_lod_count () const -> uint32_t
 Gets the number of LOD levels available.
 
auto get_lod_submeshes (uint32_t lod_index) const -> const submesh_array_t *
 Gets submeshes for a specific LOD level.
 
auto get_lod_face_count (uint32_t lod_index) const -> uint32_t
 Gets the face count for a specific LOD level.
 
auto get_lod_index_data (uint32_t lod_index, std::vector< uint32_t > &out_indices, float &out_error) const -> bool
 Gets index buffer data for a specific LOD level (for serialization).
 
auto restore_lods_from_load_data (const load_data &data) -> bool
 Restores LOD levels from load_data into the mesh.
 

Static Public Member Functions

static auto get_max_lod_count () -> uint32_t
 Gets the maximum number of LODs that can be used for this mesh including base LOD.
 
static auto get_max_generated_lod_count () -> uint32_t
 Gets the maximum number of LODs that can be generated for a mesh.
 
static auto generate_default_lod_configs (const load_data &data, float target_error=0.01f) -> std::vector< std::pair< size_t, float > >
 Generates default LOD configurations based on mesh triangle count.
 
static auto apply_skin_to_load_data (load_data &data) -> bool
 Applies skinning vertex duplication to load_data (for offline LOD generation).
 
static auto generate_lods_for_load_data (load_data &data, const std::vector< std::pair< size_t, float > > &lod_configs) -> bool
 Generates LOD levels directly in load_data without creating GPU buffers.
 

Protected Types

using submesh_key_map_t = std::map<mesh_submesh_key, submesh*>
 
using submesh_key_array_t = std::vector<mesh_submesh_key>
 
using bone_combination_map_t = std::map<bone_combination_key, std::vector<uint32_t>*>
 

Protected Member Functions

void check_for_degenerates ()
 
auto generate_vertex_components (bool weld) -> bool
 Generates any vertex components that may be missing, such as normals, tangents, or binormals.
 
auto generate_vertex_normals (uint32_t *adjacency_ptr, std::vector< uint32_t > *remap_array_ptr=nullptr) -> bool
 Generates vertex normals for the mesh.
 
auto generate_vertex_barycentrics (uint32_t *adjacency) -> bool
 Generates vertex barycentric coordinates for the mesh.
 
auto generate_vertex_tangents () -> bool
 Generates vertex tangents for the mesh.
 
auto weld_vertices (float tolerance=0.000001f, std::vector< uint32_t > *vertex_remap_ptr=nullptr) -> bool
 Welds the vertices together that can be combined.
 
auto sort_mesh_data () -> bool
 Sorts the data in the mesh into material and data group order.
 

Protected Attributes

bool force_tangent_generation_ = false
 < Whether to force the generation of tangent space vectors.
 
bool force_normal_generation_ = false
 Whether to force the generation of vertex barycentric coordinates.
 
bool force_barycentric_generation_ = false
 Whether to disable the automatic re-sort operation.
 
bool disable_final_sort_ = false
 The vertex data during data insertion and system memory copy.
 
uint8_t * system_vb_ = nullptr
 The vertex format used for the mesh internal vertex data.
 
gfx::vertex_layout vertex_format_
 The final system memory copy of the index buffer (LOD 0 - base mesh).
 
uint32_t * system_ib_ = nullptr
 Material and data group information for each triangle.
 
submesh_key_array_t triangle_data_
 The actual hardware vertex buffer resource (shared by all LODs).
 
std::shared_ptr< void > hardware_vb_
 The actual hardware index buffer resource (LOD 0 - base mesh).
 
std::shared_ptr< void > hardware_ib_
 Additional LOD levels (LOD 1, 2, 3, ...) with simplified index buffers.
 
std::vector< lod_levellods_
 Current LOD count (including base LOD 0).
 
uint32_t lod_count_ = 1
 The actual list of submeshes maintained by this mesh.
 
submesh_array_t mesh_submeshes_
 Indices in the subset array which are skinned.
 
submesh_array_map_t skinned_submesh_indices_
 
size_t skinned_submesh_count_ {}
 Indices in the subset array which are not skinned.
 
submesh_array_map_t non_skinned_submesh_indices_
 
size_t non_skinned_submesh_count_ {}
 Lookup information mapping data groups to submeshes batched by material.
 
data_group_submesh_map_t data_groups_
 Whether the mesh uses a hardware vertex/index buffer.
 
bool hardware_mesh_ = true
 Whether the mesh was optimized when it was prepared.
 
bool optimize_mesh_ = false
 Axis aligned bounding box describing object dimensions in object space.
 
math::bbox bbox_
 Total number of faces in the prepared mesh.
 
uint32_t face_count_ = 0
 Total number of vertices in the prepared mesh.
 
uint32_t vertex_count_ = 0
 Preparation status of the mesh.
 
mesh_status prepare_status_ = mesh_status::not_prepared
 Input data used for constructing the final mesh.
 
preparation_data preparation_data_
 Data describing how the mesh should be bound as a skin with supplied bone matrices.
 
skin_bind_data skin_bind_data_
 List of unique combinations of bones to use during rendering.
 
bone_palette_array_t bone_palettes_
 List of armature nodes.
 
std::unique_ptr< armature_noderoot_ = nullptr
 UIDs of default materials generated during import, indexed by data_group_id.
 
std::vector< hpp::uuid > default_material_uids_
 

Friends

auto operator< (const adjacent_edge_key &key1, const adjacent_edge_key &key2) -> bool
 
auto operator< (const mesh_submesh_key &key1, const mesh_submesh_key &key2) -> bool
 
auto operator< (const weld_key &key1, const weld_key &key2) -> bool
 
auto operator< (const bone_combination_key &key1, const bone_combination_key &key2) -> bool
 

Detailed Description

Main class representing a 3D mesh with support for different LODs, submeshes, and skinning.

Definition at line 322 of file mesh.h.

Member Typedef Documentation

◆ bone_combination_map_t

using unravel::mesh::bone_combination_map_t = std::map<bone_combination_key, std::vector<uint32_t>*>
protected

Definition at line 1200 of file mesh.h.

◆ bone_palette_array_t

Definition at line 390 of file mesh.h.

◆ byte_array_t

using unravel::mesh::byte_array_t = std::vector<uint8_t>

Definition at line 395 of file mesh.h.

◆ data_group_submesh_map_t

Definition at line 394 of file mesh.h.

◆ submesh_array_indices_t

using unravel::mesh::submesh_array_indices_t = std::vector<size_t>

Definition at line 391 of file mesh.h.

◆ submesh_array_map_t

Definition at line 392 of file mesh.h.

◆ submesh_array_t

using unravel::mesh::submesh_array_t = std::vector<submesh*>

Definition at line 389 of file mesh.h.

◆ submesh_key_array_t

using unravel::mesh::submesh_key_array_t = std::vector<mesh_submesh_key>
protected

Definition at line 1174 of file mesh.h.

◆ submesh_key_map_t

Definition at line 1173 of file mesh.h.

◆ triangle_array_t

Definition at line 388 of file mesh.h.

Constructor & Destructor Documentation

◆ mesh()

unravel::mesh::mesh ( )

Constructs a mesh object.

Definition at line 159 of file mesh.cpp.

◆ ~mesh()

unravel::mesh::~mesh ( )

Destructor.

Definition at line 163 of file mesh.cpp.

Member Function Documentation

◆ apply_skin_to_load_data()

auto unravel::mesh::apply_skin_to_load_data ( load_data & data) -> bool
static

Applies skinning vertex duplication to load_data (for offline LOD generation).

Parameters
dataThe load_data to apply skinning to (will be modified)
Returns
true if skinning was applied successfully

Definition at line 2033 of file mesh.cpp.

◆ bind_armature()

auto unravel::mesh::bind_armature ( std::unique_ptr< armature_node > & root) -> bool

Binds the armature tree.

Parameters
rootThe root node of the armature.
Returns
true If the armature was successfully bound.
false If binding the armature failed.

Definition at line 816 of file mesh.cpp.

◆ bind_render_buffers_for_submesh()

void unravel::mesh::bind_render_buffers_for_submesh ( const submesh * submesh,
uint32_t lod_index = 0 )

Binds the mesh data for rendering the selected batch of primitives.

Parameters
face_startThe starting face index.
face_countThe number of faces to render.
vertex_startThe starting vertex index.
vertex_countThe number of vertices to render.

Definition at line 4110 of file mesh.cpp.

◆ bind_skin()

auto unravel::mesh::bind_skin ( const skin_bind_data & bind_data) -> bool

Binds the mesh as a skin with the specified skin binding data.

Parameters
bind_dataThe skin binding data.
Returns
true If the mesh was successfully bound as a skin.
false If binding the mesh as a skin failed.

Definition at line 579 of file mesh.cpp.

◆ build_ib()

void unravel::mesh::build_ib ( bool hardware_copy = true)

Builds the internal index buffer.

Parameters
hardware_copyWhether to use hardware copy.

Definition at line 1310 of file mesh.cpp.

◆ build_vb()

void unravel::mesh::build_vb ( bool hardware_copy = true)

Builds the internal vertex buffer.

Parameters
hardware_copyWhether to use hardware copy.

Definition at line 1291 of file mesh.cpp.

◆ calculate_screen_rect()

auto unravel::mesh::calculate_screen_rect ( const math::transform & world,
const camera & cam ) const -> irect32_t

Calculates the screen rectangle of the mesh based on its world transform and the camera. This version uses a conservative approach - if any corners are behind the camera, it returns the full viewport as the screen rect. Fast but may overestimate coverage.

Parameters
worldThe world transform of the mesh.
camThe camera.
Returns
irect32_t The screen rectangle.

Definition at line 1790 of file mesh.cpp.

◆ calculate_screen_rect_precise()

auto unravel::mesh::calculate_screen_rect_precise ( const math::transform & world,
const camera & cam ) const -> irect32_t

Calculates the screen rectangle of the mesh with precise near-plane clipping. This version properly clips edges that cross the near plane for accurate screen coverage. More accurate but slightly more expensive than calculate_screen_rect.

Parameters
worldThe world transform of the mesh.
camThe camera.
Returns
irect32_t The screen rectangle.

Definition at line 1680 of file mesh.cpp.

◆ check_for_degenerates()

void unravel::mesh::check_for_degenerates ( )
protected

Definition at line 1183 of file mesh.cpp.

◆ create_capsule()

auto unravel::mesh::create_capsule ( const gfx::vertex_layout & format,
float radius,
float height,
uint32_t stacks,
uint32_t slices,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Creates a capsule geometry.

Parameters
formatThe vertex format.
radiusThe radius of the capsule.
heightThe height of the capsule.
stacksThe number of stacks.
slicesThe number of slices.
originThe origin of the capsule.
hardware_copyWhether to use hardware copy.
Returns
true If the capsule was successfully created.
false If creating the capsule failed.

Definition at line 1058 of file mesh.cpp.

◆ create_cone()

auto unravel::mesh::create_cone ( const gfx::vertex_layout & format,
float radius,
float radius_tip,
float height,
uint32_t stacks,
uint32_t slices,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Creates a cone geometry.

Parameters
formatThe vertex format.
radiusThe base radius of the cone.
radius_tipThe tip radius of the cone.
heightThe height of the cone.
stacksThe number of stacks.
slicesThe number of slices.
originThe origin of the cone.
hardware_copyWhether to use hardware copy.
Returns
true If the cone was successfully created.
false If creating the cone failed.

Definition at line 1079 of file mesh.cpp.

◆ create_cube()

auto unravel::mesh::create_cube ( const gfx::vertex_layout & format,
float width,
float height,
float depth,
uint32_t width_segments,
uint32_t height_segments,
uint32_t depth_segments,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Creates a cube geometry.

Parameters
formatThe vertex format.
widthThe width of the cube.
heightThe height of the cube.
depthThe depth of the cube.
width_segmentsThe number of segments along the width.
height_segmentsThe number of segments along the height.
depth_segmentsThe number of segments along the depth.
originThe origin of the cube.
hardware_copyWhether to use hardware copy.
Returns
true If the cube was successfully created.
false If creating the cube failed.

Definition at line 966 of file mesh.cpp.

◆ create_cylinder()

auto unravel::mesh::create_cylinder ( const gfx::vertex_layout & format,
float radius,
float height,
uint32_t stacks,
uint32_t slices,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Creates a cylinder geometry.

Parameters
formatThe vertex format.
radiusThe radius of the cylinder.
heightThe height of the cylinder.
stacksThe number of stacks.
slicesThe number of slices.
originThe origin of the cylinder.
hardware_copyWhether to use hardware copy.
Returns
true If the cylinder was successfully created.
false If creating the cylinder failed.

Definition at line 1033 of file mesh.cpp.

◆ create_dodecahedron()

auto unravel::mesh::create_dodecahedron ( const gfx::vertex_layout & format,
bool hardware_copy = true ) -> bool

Creates a dodecahedron geometry.

Parameters
formatThe vertex format.
hardware_copyWhether to use hardware copy.
Returns
true If the dodecahedron was successfully created.
false If creating the dodecahedron failed.

Definition at line 1152 of file mesh.cpp.

◆ create_heightfield()

auto unravel::mesh::create_heightfield ( const gfx::vertex_layout & format,
hpp::span< const float > heights,
uint32_t segments_x,
uint32_t segments_z,
float half_extent_x,
float half_extent_z,
float height_scale,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Creates a heightfield on the XZ plane (Y up): vertex grid (segments_x+1)*(segments_z+1).

Parameters
heightsRow-major samples indexed by z * (segments_x+1) + x, values in arbitrary units scaled by height_scale.
half_extent_xHalf world size along X; vertices span [-half_extent_x, half_extent_x].
half_extent_zHalf world size along Z.
height_scaleMultiplier applied to each height sample before placing along Y.

Definition at line 904 of file mesh.cpp.

◆ create_icosahedron()

auto unravel::mesh::create_icosahedron ( const gfx::vertex_layout & format,
bool hardware_copy = true ) -> bool

Creates an icosahedron geometry.

Parameters
formatThe vertex format.
hardware_copyWhether to use hardware copy.
Returns
true If the icosahedron was successfully created.
false If creating the icosahedron failed.

Definition at line 1137 of file mesh.cpp.

◆ create_icosphere()

auto unravel::mesh::create_icosphere ( const gfx::vertex_layout & format,
int tesselation_level,
bool hardware_copy = true ) -> bool

Creates an icosphere geometry.

Parameters
formatThe vertex format.
tesselation_levelThe level of tesselation.
hardware_copyWhether to use hardware copy.
Returns
true If the icosphere was successfully created.
false If creating the icosphere failed.

Definition at line 1167 of file mesh.cpp.

◆ create_plane()

auto unravel::mesh::create_plane ( const gfx::vertex_layout & format,
float width,
float height,
uint32_t width_segments,
uint32_t height_segments,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Creates a plane geometry.

Parameters
formatThe vertex format.
widthThe width of the plane.
heightThe height of the plane.
width_segmentsThe number of segments along the width.
height_segmentsThe number of segments along the height.
originThe origin of the plane.
hardware_copyWhether to use hardware copy.
Returns
true If the plane was successfully created.
false If creating the plane failed.

Definition at line 879 of file mesh.cpp.

◆ create_rounded_cube()

auto unravel::mesh::create_rounded_cube ( const gfx::vertex_layout & format,
float width,
float height,
float depth,
uint32_t width_segments,
uint32_t height_segments,
uint32_t depth_segments,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Definition at line 990 of file mesh.cpp.

◆ create_sphere()

auto unravel::mesh::create_sphere ( const gfx::vertex_layout & format,
float radius,
uint32_t stacks,
uint32_t slices,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Creates a sphere geometry.

Parameters
formatThe vertex format.
radiusThe radius of the sphere.
stacksThe number of stacks.
slicesThe number of slices.
originThe origin of the sphere.
hardware_copyWhether to use hardware copy.
Returns
true If the sphere was successfully created.
false If creating the sphere failed.

Definition at line 1013 of file mesh.cpp.

◆ create_teapot()

auto unravel::mesh::create_teapot ( const gfx::vertex_layout & format,
bool hardware_copy = true ) -> bool

Creates a teapot geometry.

Parameters
formatThe vertex format.
hardware_copyWhether to use hardware copy.
Returns
true If the teapot was successfully created.
false If creating the teapot failed.

Definition at line 1122 of file mesh.cpp.

◆ create_torus()

auto unravel::mesh::create_torus ( const gfx::vertex_layout & format,
float outer_radius,
float inner_radius,
uint32_t bands,
uint32_t sides,
mesh_create_origin origin,
bool hardware_copy = true ) -> bool

Creates a torus geometry.

Parameters
formatThe vertex format.
outer_radiusThe outer radius of the torus.
inner_radiusThe inner radius of the torus.
bandsThe number of bands.
sidesThe number of sides.
originThe origin of the torus.
hardware_copyWhether to use hardware copy.
Returns
true If the torus was successfully created.
false If creating the torus failed.

Definition at line 1101 of file mesh.cpp.

◆ dispose()

void unravel::mesh::dispose ( )

Clears out all the mesh data.

Definition at line 168 of file mesh.cpp.

◆ end_prepare()

auto unravel::mesh::end_prepare ( bool hardware_copy = true,
bool build_buffers = true,
bool weld = false,
bool optimize = false ) -> bool

Ends the preparation of the mesh and builds the render data.

Parameters
hardware_copyWhether to use hardware copy.
weldWhether to weld vertices.
optimizeWhether to optimize the mesh.
build_buffersWhether to build the render buffers.
Returns
true If the mesh was successfully prepared.
false If the mesh preparation failed.

Definition at line 1218 of file mesh.cpp.

◆ find_submesh_index_by_stable_id()

auto unravel::mesh::find_submesh_index_by_stable_id ( uint32_t stable_id,
uint32_t lod_index = 0 ) const -> int

Finds the submesh array index matching an import-stable submesh identifier.

Parameters
stable_idThe stable identifier assigned at import time (see submesh::stable_id).
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
Index of the submesh, or -1 if no submesh carries that id.

Definition at line 1922 of file mesh.cpp.

◆ generate_adjacency()

auto unravel::mesh::generate_adjacency ( std::vector< uint32_t > & adjacency) -> bool

Generates edge-triangle adjacency information for the mesh data.

Parameters
adjacencyThe adjacency information output array.
Returns
true If the adjacency information was successfully generated.
false If generating the adjacency information failed.

Definition at line 1344 of file mesh.cpp.

◆ generate_default_lod_configs()

auto unravel::mesh::generate_default_lod_configs ( const load_data & data,
float target_error = 0.01f ) -> std::vector<std::pair<size_t, float>>
static

Generates default LOD configurations based on mesh triangle count.

Parameters
dataThe load_data to generate LOD configs for
target_errorBase target error for LOD generation (default: 0.01)
Returns
Vector of LOD configurations: {target_triangle_count, target_error}

Definition at line 2018 of file mesh.cpp.

◆ generate_lods_for_load_data()

auto unravel::mesh::generate_lods_for_load_data ( load_data & data,
const std::vector< std::pair< size_t, float > > & lod_configs ) -> bool
static

Generates LOD levels directly in load_data without creating GPU buffers.

Parameters
dataThe load_data to generate LODs for (will be modified)
lod_configsVector of LOD configurations: {target_triangle_count, target_error}
optionsmeshoptimizer simplification options (default: 0)
Returns
true if LODs were generated successfully

Definition at line 2236 of file mesh.cpp.

◆ generate_vertex_barycentrics()

auto unravel::mesh::generate_vertex_barycentrics ( uint32_t * adjacency) -> bool
protected

Generates vertex barycentric coordinates for the mesh.

Parameters
adjacencyPointer to the adjacency information.
Returns
true If the vertex barycentric coordinates were successfully generated.
false If generating the vertex barycentric coordinates failed.

Definition at line 3309 of file mesh.cpp.

◆ generate_vertex_components()

auto unravel::mesh::generate_vertex_components ( bool weld) -> bool
protected

Generates any vertex components that may be missing, such as normals, tangents, or binormals.

Parameters
weldWhether to weld vertices.
Returns
true If the vertex components were successfully generated.
false If generating the vertex components failed.

Definition at line 2948 of file mesh.cpp.

◆ generate_vertex_normals()

auto unravel::mesh::generate_vertex_normals ( uint32_t * adjacency_ptr,
std::vector< uint32_t > * remap_array_ptr = nullptr ) -> bool
protected

Generates vertex normals for the mesh.

Parameters
adjacency_ptrPointer to the adjacency information.
remap_array_ptrPointer to the vertex remap array.
Returns
true If the vertex normals were successfully generated.
false If generating the vertex normals failed.

Definition at line 3024 of file mesh.cpp.

◆ generate_vertex_tangents()

auto unravel::mesh::generate_vertex_tangents ( ) -> bool
protected

Generates vertex tangents for the mesh.

Returns
true If the vertex tangents were successfully generated.
false If generating the vertex tangents failed.

Definition at line 3315 of file mesh.cpp.

◆ get_armature()

auto unravel::mesh::get_armature ( ) const -> const std::unique_ptr<armature_node>&

Retrieves the armature tree of the mesh.

Returns
const std::unique_ptr<armature_node>& The root node of the armature tree.

Definition at line 1642 of file mesh.cpp.

◆ get_bone_palettes()

auto unravel::mesh::get_bone_palettes ( ) const -> const bone_palette_array_t&

Retrieves the compiled bone combination palette data if this mesh has been bound as a skin.

Returns
const bone_palette_array_t& The bone palette data.

Definition at line 1637 of file mesh.cpp.

◆ get_bounds()

auto unravel::mesh::get_bounds ( ) const -> const math::bbox&

Gets the local bounding box for this mesh.

Returns
const math::bbox& The bounding box.

Definition at line 2730 of file mesh.cpp.

◆ get_data_groups_count()

auto unravel::mesh::get_data_groups_count ( ) const -> size_t

Gets the number of data groups(materials) for this mesh.

Returns
size_t The number of data groups.

Definition at line 2740 of file mesh.cpp.

◆ get_default_material_uids()

auto unravel::mesh::get_default_material_uids ( ) const -> const std::vector<hpp::uuid>&

Gets the default material UIDs generated during import.

Returns
A constant reference to the vector of material UIDs, indexed by data_group_id.

Definition at line 2759 of file mesh.cpp.

◆ get_face_count()

auto unravel::mesh::get_face_count ( ) const -> uint32_t

Determines the number of faces stored in the mesh.

Returns
uint32_t The number of faces.

Definition at line 1569 of file mesh.cpp.

◆ get_hardware_ib()

auto unravel::mesh::get_hardware_ib ( uint32_t lod_index = 0) const -> std::shared_ptr<gfx::index_buffer>

Retrieves the hardware index buffer for a given LOD.

The buffer is created with BGFX_BUFFER_COMPUTE_READ so it can be bound to compute-style read buffers in shaders (e.g. vertex pulling).

Parameters
lod_indexThe LOD level (0 = base).
Returns
std::shared_ptr<gfx::index_buffer> The hardware index buffer, or null if unavailable.

Definition at line 1617 of file mesh.cpp.

◆ get_hardware_vb()

auto unravel::mesh::get_hardware_vb ( ) const -> std::shared_ptr<gfx::vertex_buffer>

Retrieves the hardware vertex buffer for the mesh (shared across all LODs).

The buffer is created with BGFX_BUFFER_COMPUTE_READ so it can be bound to compute-style read buffers in shaders (e.g. vertex pulling).

Returns
std::shared_ptr<gfx::vertex_buffer> The hardware vertex buffer, or null if unavailable.

Definition at line 1612 of file mesh.cpp.

◆ get_imported_materials()

auto unravel::mesh::get_imported_materials ( ) const -> std::vector<asset_handle<material>>

Gets the imported materials generated during import.

Returns
A constant reference to the vector of imported materials.

Definition at line 2765 of file mesh.cpp.

◆ get_info()

auto unravel::mesh::get_info ( ) const -> info

Definition at line 248 of file mesh.cpp.

◆ get_lod_count()

auto unravel::mesh::get_lod_count ( ) const -> uint32_t

Gets the number of LOD levels available.

Returns
Number of LODs (including base LOD 0)

Definition at line 1942 of file mesh.cpp.

◆ get_lod_face_count()

auto unravel::mesh::get_lod_face_count ( uint32_t lod_index) const -> uint32_t

Gets the face count for a specific LOD level.

Parameters
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
Face count, or 0 if LOD doesn't exist

Definition at line 1962 of file mesh.cpp.

◆ get_lod_index_data()

auto unravel::mesh::get_lod_index_data ( uint32_t lod_index,
std::vector< uint32_t > & out_indices,
float & out_error ) const -> bool

Gets index buffer data for a specific LOD level (for serialization).

Parameters
lod_indexLOD index (0 = base, 1+ = simplified)
out_indicesOutput vector to store index data
out_errorOutput simplification error
Returns
true if LOD data was retrieved successfully

Definition at line 1977 of file mesh.cpp.

◆ get_lod_submeshes()

auto unravel::mesh::get_lod_submeshes ( uint32_t lod_index) const -> const submesh_array_t*

Gets submeshes for a specific LOD level.

Parameters
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
Pointer to submesh array, or nullptr if LOD doesn't exist

Definition at line 1947 of file mesh.cpp.

◆ get_max_generated_lod_count()

auto unravel::mesh::get_max_generated_lod_count ( ) -> uint32_t
static

Gets the maximum number of LODs that can be generated for a mesh.

Returns
The maximum number of LODs that can be generated.

Definition at line 2013 of file mesh.cpp.

◆ get_max_lod_count()

auto unravel::mesh::get_max_lod_count ( ) -> uint32_t
static

Gets the maximum number of LODs that can be used for this mesh including base LOD.

Returns
The maximum number of LODs that can be used.

Definition at line 2008 of file mesh.cpp.

◆ get_non_skinned_submeshes_count()

auto unravel::mesh::get_non_skinned_submeshes_count ( uint32_t lod_index = 0) const -> size_t

Gets the number of non-skinned submeshes for this mesh.

Parameters
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
size_t The number of non-skinned submeshes.

Definition at line 2687 of file mesh.cpp.

◆ get_non_skinned_submeshes_indices()

auto unravel::mesh::get_non_skinned_submeshes_indices ( uint32_t data_group_id,
uint32_t lod_index = 0 ) const -> const submesh_array_indices_t&

Gets the indices of non-skinned submeshes for a specific data group.

Parameters
data_group_idThe data group identifier.
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
const submesh_array_indices_t& The indices of non-skinned submeshes.

Definition at line 2701 of file mesh.cpp.

◆ get_skin_bind_data()

auto unravel::mesh::get_skin_bind_data ( ) const -> const skin_bind_data&

Retrieves the skin bind data if this mesh has been bound as a skin.

Returns
const skin_bind_data& The skin bind data.

Definition at line 1632 of file mesh.cpp.

◆ get_skinned_submeshes_count()

auto unravel::mesh::get_skinned_submeshes_count ( uint32_t lod_index = 0) const -> size_t

Gets the number of skinned submeshes for this mesh.

Parameters
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
size_t The number of skinned submeshes.

Definition at line 2644 of file mesh.cpp.

◆ get_skinned_submeshes_indices()

auto unravel::mesh::get_skinned_submeshes_indices ( uint32_t data_group_id,
uint32_t lod_index = 0 ) const -> const submesh_array_indices_t&

Gets the indices of skinned submeshes for a specific data group.

Parameters
data_group_idThe data group identifier.
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
const submesh_array_indices_t& The indices of skinned submeshes.

Definition at line 2658 of file mesh.cpp.

◆ get_status()

auto unravel::mesh::get_status ( ) const -> mesh_status

Gets the preparation status for this mesh.

Returns
mesh_status The preparation status.

Definition at line 2735 of file mesh.cpp.

◆ get_submesh()

auto unravel::mesh::get_submesh ( uint32_t submesh_index = 0,
uint32_t lod_index = 0 ) const -> const submesh*

Definition at line 1896 of file mesh.cpp.

◆ get_submesh_index()

auto unravel::mesh::get_submesh_index ( const submesh * s,
uint32_t lod_index = 0 ) const -> int

Gets the index of a submesh within the submesh array.

Parameters
sPointer to the submesh to find.
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
Index of the submesh, or -1 if not found.

Definition at line 1906 of file mesh.cpp.

◆ get_submesh_node_transforms()

auto unravel::mesh::get_submesh_node_transforms ( uint32_t lod_index = 0) const -> std::vector<math::transform>

Computes the accumulated node transform for each submesh.

The mesh vertex buffer stores positions in node-local space; the renderer applies each submesh's accumulated armature node transform (relative to the model root) on top. This helper walks the armature tree and returns, for every submesh index, the transform (relative to the model root) of the node that owns that submesh. Submeshes not referenced by any node receive identity.

Parameters
lod_indexThe LOD level whose submesh count is used to size the result.
Returns
std::vector<math::transform> Per-submesh node transforms indexed by submesh index.

Definition at line 1672 of file mesh.cpp.

◆ get_submeshes()

auto unravel::mesh::get_submeshes ( uint32_t lod_index = 0) const -> const submesh_array_t&

Retrieves information about the submesh of the mesh associated with the specified data group identifier.

Parameters
data_group_idThe data group identifier.
Returns
const submesh* Pointer to the submesh information.

Definition at line 1864 of file mesh.cpp.

◆ get_submeshes_count()

auto unravel::mesh::get_submeshes_count ( uint32_t lod_index = 0) const -> size_t

Gets the number of submeshes for this mesh.

Parameters
lod_indexLOD index (0 = base, 1+ = simplified)
Returns
size_t The number of submeshes.

Definition at line 1880 of file mesh.cpp.

◆ get_system_ib()

auto unravel::mesh::get_system_ib ( ) -> uint32_t*

Retrieves the underlying index data from the mesh.

Returns
uint32_t* The index data.

Definition at line 1602 of file mesh.cpp.

◆ get_system_vb()

auto unravel::mesh::get_system_vb ( ) -> uint8_t*

Retrieves the underlying vertex data from the mesh.

Returns
uint8_t* The vertex data.

Definition at line 1597 of file mesh.cpp.

◆ get_vertex_count()

auto unravel::mesh::get_vertex_count ( ) const -> uint32_t

Determines the number of vertices stored in the mesh.

Returns
uint32_t The number of vertices.

Definition at line 1583 of file mesh.cpp.

◆ get_vertex_format()

auto unravel::mesh::get_vertex_format ( ) const -> const gfx::vertex_layout&

Retrieves the format of the underlying mesh vertex data.

Returns
const gfx::vertex_layout& The vertex format.

Definition at line 1607 of file mesh.cpp.

◆ load_mesh()

auto unravel::mesh::load_mesh ( load_data && data) -> bool

Definition at line 824 of file mesh.cpp.

◆ prepare_mesh()

auto unravel::mesh::prepare_mesh ( const gfx::vertex_layout & vertex_format) -> bool

Prepares the mesh with the specified vertex format.

Parameters
vertex_formatThe vertex format to use.
Returns
true If the mesh was successfully prepared.
false If the mesh preparation failed.

Definition at line 270 of file mesh.cpp.

◆ restore_lods_from_load_data()

auto unravel::mesh::restore_lods_from_load_data ( const load_data & data) -> bool

Restores LOD levels from load_data into the mesh.

Parameters
dataThe load_data containing LOD information
Returns
true if LODs were restored successfully

Definition at line 2570 of file mesh.cpp.

◆ set_bounding_box()

auto unravel::mesh::set_bounding_box ( const math::bbox & box) -> bool

Definition at line 398 of file mesh.cpp.

◆ set_primitives()

auto unravel::mesh::set_primitives ( triangle_array_t && triangles) -> bool

Adds primitives (triangles) to the mesh.

Parameters
trianglesThe triangles to add.
Returns
true If the primitives were successfully added.
false If adding the primitives failed.

Definition at line 424 of file mesh.cpp.

◆ set_submeshes()

auto unravel::mesh::set_submeshes ( const std::vector< submesh > & submeshes) -> bool

Definition at line 406 of file mesh.cpp.

◆ set_vertex_source() [1/2]

auto unravel::mesh::set_vertex_source ( byte_array_t && source,
uint32_t vertex_count,
const gfx::vertex_layout & source_format ) -> bool

Definition at line 296 of file mesh.cpp.

◆ set_vertex_source() [2/2]

auto unravel::mesh::set_vertex_source ( void * source,
uint32_t vertex_count,
const gfx::vertex_layout & source_format ) -> bool

Sets the source of the vertex buffer to pull data from while preparing the mesh.

Parameters
sourceThe source vertex data.
vertex_countThe number of vertices.
source_formatThe format of the source vertex data.
Returns
true If the vertex source was successfully set.
false If setting the vertex source failed.

◆ sort_mesh_data()

auto unravel::mesh::sort_mesh_data ( ) -> bool
protected

Sorts the data in the mesh into material and data group order.

Returns
true If the mesh data was successfully sorted.
false If sorting the mesh data failed.

Definition at line 4038 of file mesh.cpp.

◆ weld_vertices()

auto unravel::mesh::weld_vertices ( float tolerance = 0.000001f,
std::vector< uint32_t > * vertex_remap_ptr = nullptr ) -> bool
protected

Welds the vertices together that can be combined.

Parameters
toleranceThe tolerance for welding vertices.
vertexRemapPointer to the vertex remap array.
Returns
true If the vertices were successfully welded.
false If welding the vertices failed.

Definition at line 3530 of file mesh.cpp.

Friends And Related Symbol Documentation

◆ operator< [1/4]

auto operator< ( const adjacent_edge_key & key1,
const adjacent_edge_key & key2 ) -> bool
friend

Definition at line 2779 of file mesh.cpp.

◆ operator< [2/4]

auto operator< ( const bone_combination_key & key1,
const bone_combination_key & key2 ) -> bool
friend

Definition at line 2915 of file mesh.cpp.

◆ operator< [3/4]

auto operator< ( const mesh_submesh_key & key1,
const mesh_submesh_key & key2 ) -> bool
friend

Definition at line 2812 of file mesh.cpp.

◆ operator< [4/4]

auto operator< ( const weld_key & key1,
const weld_key & key2 ) -> bool
friend

Definition at line 2817 of file mesh.cpp.

Member Data Documentation

◆ bbox_

math::bbox unravel::mesh::bbox_
protected

Total number of faces in the prepared mesh.

Definition at line 1311 of file mesh.h.

◆ bone_palettes_

bone_palette_array_t unravel::mesh::bone_palettes_
protected

List of armature nodes.

Definition at line 1325 of file mesh.h.

◆ data_groups_

data_group_submesh_map_t unravel::mesh::data_groups_
protected

Whether the mesh uses a hardware vertex/index buffer.

Definition at line 1304 of file mesh.h.

◆ default_material_uids_

std::vector<hpp::uuid> unravel::mesh::default_material_uids_
protected

Definition at line 1330 of file mesh.h.

◆ disable_final_sort_

bool unravel::mesh::disable_final_sort_ = false
protected

The vertex data during data insertion and system memory copy.

Definition at line 1272 of file mesh.h.

◆ face_count_

uint32_t unravel::mesh::face_count_ = 0
protected

Total number of vertices in the prepared mesh.

Definition at line 1313 of file mesh.h.

◆ force_barycentric_generation_

bool unravel::mesh::force_barycentric_generation_ = false
protected

Whether to disable the automatic re-sort operation.

Definition at line 1270 of file mesh.h.

◆ force_normal_generation_

bool unravel::mesh::force_normal_generation_ = false
protected

Whether to force the generation of vertex barycentric coordinates.

Definition at line 1268 of file mesh.h.

◆ force_tangent_generation_

bool unravel::mesh::force_tangent_generation_ = false
protected

< Whether to force the generation of tangent space vectors.

Whether to force the generation of vertex normals.

Definition at line 1266 of file mesh.h.

◆ hardware_ib_

std::shared_ptr<void> unravel::mesh::hardware_ib_
protected

Additional LOD levels (LOD 1, 2, 3, ...) with simplified index buffers.

Definition at line 1285 of file mesh.h.

◆ hardware_mesh_

bool unravel::mesh::hardware_mesh_ = true
protected

Whether the mesh was optimized when it was prepared.

Definition at line 1307 of file mesh.h.

◆ hardware_vb_

std::shared_ptr<void> unravel::mesh::hardware_vb_
protected

The actual hardware index buffer resource (LOD 0 - base mesh).

Definition at line 1283 of file mesh.h.

◆ lod_count_

uint32_t unravel::mesh::lod_count_ = 1
protected

The actual list of submeshes maintained by this mesh.

Definition at line 1290 of file mesh.h.

◆ lods_

std::vector<lod_level> unravel::mesh::lods_
protected

Current LOD count (including base LOD 0).

Definition at line 1288 of file mesh.h.

◆ mesh_submeshes_

submesh_array_t unravel::mesh::mesh_submeshes_
protected

Indices in the subset array which are skinned.

Definition at line 1293 of file mesh.h.

◆ non_skinned_submesh_count_

size_t unravel::mesh::non_skinned_submesh_count_ {}
protected

Lookup information mapping data groups to submeshes batched by material.

Definition at line 1301 of file mesh.h.

◆ non_skinned_submesh_indices_

submesh_array_map_t unravel::mesh::non_skinned_submesh_indices_
protected

Definition at line 1300 of file mesh.h.

◆ optimize_mesh_

bool unravel::mesh::optimize_mesh_ = false
protected

Axis aligned bounding box describing object dimensions in object space.

Definition at line 1309 of file mesh.h.

◆ preparation_data_

preparation_data unravel::mesh::preparation_data_
protected

Data describing how the mesh should be bound as a skin with supplied bone matrices.

Definition at line 1320 of file mesh.h.

◆ prepare_status_

mesh_status unravel::mesh::prepare_status_ = mesh_status::not_prepared
protected

Input data used for constructing the final mesh.

Definition at line 1318 of file mesh.h.

◆ root_

std::unique_ptr<armature_node> unravel::mesh::root_ = nullptr
protected

UIDs of default materials generated during import, indexed by data_group_id.

Definition at line 1327 of file mesh.h.

◆ skin_bind_data_

skin_bind_data unravel::mesh::skin_bind_data_
protected

List of unique combinations of bones to use during rendering.

Definition at line 1323 of file mesh.h.

◆ skinned_submesh_count_

size_t unravel::mesh::skinned_submesh_count_ {}
protected

Indices in the subset array which are not skinned.

Definition at line 1297 of file mesh.h.

◆ skinned_submesh_indices_

submesh_array_map_t unravel::mesh::skinned_submesh_indices_
protected

Definition at line 1296 of file mesh.h.

◆ system_ib_

uint32_t* unravel::mesh::system_ib_ = nullptr
protected

Material and data group information for each triangle.

Definition at line 1279 of file mesh.h.

◆ system_vb_

uint8_t* unravel::mesh::system_vb_ = nullptr
protected

The vertex format used for the mesh internal vertex data.

Definition at line 1275 of file mesh.h.

◆ triangle_data_

submesh_key_array_t unravel::mesh::triangle_data_
protected

The actual hardware vertex buffer resource (shared by all LODs).

Definition at line 1281 of file mesh.h.

◆ vertex_count_

uint32_t unravel::mesh::vertex_count_ = 0
protected

Preparation status of the mesh.

Definition at line 1315 of file mesh.h.

◆ vertex_format_

gfx::vertex_layout unravel::mesh::vertex_format_
protected

The final system memory copy of the index buffer (LOD 0 - base mesh).

Definition at line 1277 of file mesh.h.


The documentation for this class was generated from the following files: