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

Structure describing how a skinned mesh should be bound to any bones that influence its vertices. More...

#include <mesh.h>

Classes

struct  bone_influence
 Describes the vertices that are connected to the referenced bone and how much influence it has on them. More...
 
struct  bone_query
 
struct  vertex_data
 Contains per-vertex influence and weight information. More...
 
struct  vertex_influence
 Describes how a bone influences a specific vertex. More...
 

Public Types

using vertex_influence_array_t = std::vector<vertex_influence>
 
using bone_influence_array_t = std::vector<bone_influence>
 
using vertex_data_array_t = std::vector<vertex_data>
 

Public Member Functions

void add_bone (const bone_influence &bone)
 Adds influence information for a specific bone.
 
void remove_empty_bones ()
 Removes any bones that do not contain any influences.
 
void build_vertex_table (uint32_t vertex_count, const std::vector< uint32_t > &vertex_remap, vertex_data_array_t &table)
 Constructs a list of bone influences and weights for each vertex based on the binding data provided.
 
void remap_vertices (const std::vector< uint32_t > &remap)
 Remaps the vertex references stored in the binding based on the supplied remap array.
 
auto get_bones () const -> const bone_influence_array_t &
 Retrieves a list of all bones that influence the skin in some way.
 
auto get_bones () -> bone_influence_array_t &
 Retrieves a list of all bones that influence the skin in some way.
 
auto has_bones () const -> bool
 Checks whether the skin data has any bones.
 
auto find_bone_by_id (const std::string &id) const -> bone_query
 Finds a bone by its unique identifier.
 
void clear_vertex_influences ()
 Releases memory allocated for vertex influences in each stored bone.
 
void clear ()
 Clears out the bone information stored in this object.
 

Detailed Description

Structure describing how a skinned mesh should be bound to any bones that influence its vertices.

Definition at line 44 of file mesh.h.

Member Typedef Documentation

◆ bone_influence_array_t

Definition at line 71 of file mesh.h.

◆ vertex_data_array_t

Definition at line 87 of file mesh.h.

◆ vertex_influence_array_t

Definition at line 57 of file mesh.h.

Member Function Documentation

◆ add_bone()

void unravel::skin_bind_data::add_bone ( const bone_influence & bone)

Adds influence information for a specific bone.

Parameters
boneThe bone influence information to add.

Definition at line 2359 of file mesh.cpp.

◆ build_vertex_table()

void unravel::skin_bind_data::build_vertex_table ( uint32_t vertex_count,
const std::vector< uint32_t > & vertex_remap,
vertex_data_array_t & table )

Constructs a list of bone influences and weights for each vertex based on the binding data provided.

Parameters
vertex_countThe total number of vertices.
vertex_remapThe remap array for vertices.
tableThe output table of vertex data.

Definition at line 2425 of file mesh.cpp.

◆ clear()

void unravel::skin_bind_data::clear ( )

Clears out the bone information stored in this object.

Definition at line 2389 of file mesh.cpp.

◆ clear_vertex_influences()

void unravel::skin_bind_data::clear_vertex_influences ( )

Releases memory allocated for vertex influences in each stored bone.

Definition at line 2381 of file mesh.cpp.

◆ find_bone_by_id()

auto unravel::skin_bind_data::find_bone_by_id ( const std::string & id) const -> bone_query

Finds a bone by its unique identifier.

Parameters
idThe unique identifier of the bone.
Returns
const bone_influence* Pointer to the bone influence data if found, otherwise nullptr.

Definition at line 2489 of file mesh.cpp.

◆ get_bones() [1/2]

auto unravel::skin_bind_data::get_bones ( ) -> bone_influence_array_t&

Retrieves a list of all bones that influence the skin in some way.

Returns
bone_influence_array_t& The list of bone influences.

Definition at line 2479 of file mesh.cpp.

◆ get_bones() [2/2]

auto unravel::skin_bind_data::get_bones ( ) const -> const bone_influence_array_t&

Retrieves a list of all bones that influence the skin in some way.

Returns
const bone_influence_array_t& The list of bone influences.

Definition at line 2474 of file mesh.cpp.

◆ has_bones()

auto unravel::skin_bind_data::has_bones ( ) const -> bool

Checks whether the skin data has any bones.

Returns
true If there are bones.
false If there are no bones.

Definition at line 2484 of file mesh.cpp.

◆ remap_vertices()

void unravel::skin_bind_data::remap_vertices ( const std::vector< uint32_t > & remap)

Remaps the vertex references stored in the binding based on the supplied remap array.

Parameters
remapThe remap array.

Definition at line 2394 of file mesh.cpp.

◆ remove_empty_bones()

void unravel::skin_bind_data::remove_empty_bones ( )

Removes any bones that do not contain any influences.

Definition at line 2364 of file mesh.cpp.


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