Unravel Engine C++ Reference
|
Class that contains core data for meshes. More...
#include <model_component.h>
Public Member Functions | |
void | set_enabled (bool enabled) |
Sets whether the model is enabled. | |
void | set_casts_shadow (bool cast_shadow) |
Sets whether the model casts shadows. | |
void | set_casts_reflection (bool casts_reflection) |
Sets whether the model casts reflections. | |
void | set_static (bool is_static) |
Sets whether the model is static. | |
auto | is_enabled () const -> bool |
Checks if the model is enabled. | |
auto | casts_shadow () const -> bool |
Checks if the model casts shadows. | |
auto | casts_reflection () const -> bool |
Checks if the model casts reflections. | |
auto | is_static () const -> bool |
Checks if the model is static. | |
auto | get_model () const -> const model & |
Gets the model. | |
void | set_model (const model &model) |
Sets the model. | |
auto | get_bone_transforms () const -> const pose_mat4 & |
Gets the bone transforms. | |
auto | get_submesh_transforms () const -> const pose_mat4 & |
Gets the submesh transforms. | |
auto | get_armature_entities () const -> const std::vector< entt::handle > & |
Gets the armature entities. | |
auto | get_armature_by_id (const std::string &node_id) const -> entt::handle |
auto | get_armature_index_by_id (const std::string &node_id) const -> int |
auto | get_armature_by_index (size_t index) const -> entt::handle |
auto | get_skinning_transforms () const -> const std::vector< pose_mat4 > & |
auto | init_armature (bool force) -> bool |
Updates the armature of the model. | |
auto | update_armature () -> bool |
void | set_armature_entities (const std::vector< entt::handle > &submesh_entities) |
Sets the armature entities. | |
auto | get_world_bounds () const -> const math::bbox & |
Gets the local bounding box for this mesh. | |
auto | get_world_bounds_transform () const -> const math::transform & |
void | update_world_bounds (const math::transform &bounds) |
auto | get_local_bounds () const -> const math::bbox & |
void | set_last_render_frame (uint64_t frame) |
auto | get_last_render_frame () const noexcept -> uint64_t |
auto | was_used_last_frame () const noexcept -> bool |
auto | is_skinned () const -> bool |
auto | get_bind_pose () const -> const animation_pose & |
![]() | |
auto | operator= (const owned_component &other) -> owned_component &=default |
void | set_owner (entt::handle owner) |
Sets the owner of the component. | |
auto | get_owner () const noexcept -> entt::const_handle |
Gets the owner of the component. | |
auto | get_owner () noexcept -> entt::handle |
Gets the owner of the component. | |
![]() | |
void | touch () |
Marks the component as 'touched'. | |
Static Public Member Functions | |
static void | on_create_component (entt::registry &r, entt::entity e) |
Called when the component is created. | |
static void | on_destroy_component (entt::registry &r, entt::entity e) |
Called when the component is destroyed. | |
![]() | |
template<typename T > | |
static void | on_create_component (entt::registry &r, entt::entity e) |
template<typename T > | |
static void | on_destroy_component (entt::registry &r, entt::entity e) |
Additional Inherited Members | |
![]() | |
using | base |
![]() | |
bool | eto {} |
Disable empty type optimizations. | |
![]() | |
static constexpr bool | in_place_delete |
Indicates if the component can be deleted in place. | |
Class that contains core data for meshes.
Definition at line 13 of file model_component.h.
auto unravel::model_component::casts_reflection | ( | ) | const -> bool |
Checks if the model casts reflections.
Definition at line 424 of file model_component.cpp.
auto unravel::model_component::casts_shadow | ( | ) | const -> bool |
Checks if the model casts shadows.
Definition at line 402 of file model_component.cpp.
auto unravel::model_component::get_armature_by_id | ( | const std::string & | node_id | ) | const -> entt::handle |
Definition at line 456 of file model_component.cpp.
auto unravel::model_component::get_armature_by_index | ( | size_t | index | ) | const -> entt::handle |
Definition at line 487 of file model_component.cpp.
auto unravel::model_component::get_armature_entities | ( | ) | const -> const std::vector<entt::handle>& |
Gets the armature entities.
Definition at line 451 of file model_component.cpp.
auto unravel::model_component::get_armature_index_by_id | ( | const std::string & | node_id | ) | const -> int |
Definition at line 470 of file model_component.cpp.
auto unravel::model_component::get_bind_pose | ( | ) | const -> const animation_pose& |
Definition at line 330 of file model_component.cpp.
auto unravel::model_component::get_bone_transforms | ( | ) | const -> const pose_mat4& |
Gets the bone transforms.
Definition at line 429 of file model_component.cpp.
|
noexcept |
Definition at line 300 of file model_component.cpp.
auto unravel::model_component::get_local_bounds | ( | ) | const -> const math::bbox& |
Definition at line 278 of file model_component.cpp.
auto unravel::model_component::get_model | ( | ) | const -> const model& |
Gets the model.
Definition at line 412 of file model_component.cpp.
auto unravel::model_component::get_skinning_transforms | ( | ) | const -> const std::vector<pose_mat4>& |
Definition at line 434 of file model_component.cpp.
auto unravel::model_component::get_submesh_transforms | ( | ) | const -> const pose_mat4& |
Gets the submesh transforms.
Definition at line 439 of file model_component.cpp.
auto unravel::model_component::get_world_bounds | ( | ) | const -> const math::bbox& |
Gets the local bounding box for this mesh.
Definition at line 268 of file model_component.cpp.
auto unravel::model_component::get_world_bounds_transform | ( | ) | const -> const math::transform& |
Definition at line 273 of file model_component.cpp.
auto unravel::model_component::init_armature | ( | bool | force | ) | -> bool |
Updates the armature of the model.
Definition at line 223 of file model_component.cpp.
auto unravel::model_component::is_enabled | ( | ) | const -> bool |
Checks if the model is enabled.
Definition at line 397 of file model_component.cpp.
auto unravel::model_component::is_skinned | ( | ) | const -> bool |
Definition at line 313 of file model_component.cpp.
auto unravel::model_component::is_static | ( | ) | const -> bool |
Checks if the model is static.
Definition at line 407 of file model_component.cpp.
|
static |
Called when the component is created.
r | The registry containing the component. |
e | The entity associated with the component. |
Definition at line 335 of file model_component.cpp.
|
static |
Called when the component is destroyed.
r | The registry containing the component. |
e | The entity associated with the component. |
Definition at line 345 of file model_component.cpp.
void unravel::model_component::set_armature_entities | ( | const std::vector< entt::handle > & | submesh_entities | ) |
Sets the armature entities.
submesh_entities | A vector of handles to the armature entities. |
Definition at line 444 of file model_component.cpp.
void unravel::model_component::set_casts_reflection | ( | bool | casts_reflection | ) |
Sets whether the model casts reflections.
casts_reflection | True if the model casts reflections, false otherwise. |
Definition at line 385 of file model_component.cpp.
void unravel::model_component::set_casts_shadow | ( | bool | cast_shadow | ) |
Sets whether the model casts shadows.
cast_shadow | True if the model casts shadows, false otherwise. |
Definition at line 361 of file model_component.cpp.
void unravel::model_component::set_enabled | ( | bool | enabled | ) |
Sets whether the model is enabled.
enabled | True if the model is enabled, false otherwise. |
Definition at line 349 of file model_component.cpp.
void unravel::model_component::set_last_render_frame | ( | uint64_t | frame | ) |
Definition at line 295 of file model_component.cpp.
void unravel::model_component::set_model | ( | const model & | model | ) |
Sets the model.
model | The model to set. |
Definition at line 417 of file model_component.cpp.
void unravel::model_component::set_static | ( | bool | is_static | ) |
Sets whether the model is static.
is_static | True if the model is static, false otherwise. |
Definition at line 373 of file model_component.cpp.
auto unravel::model_component::update_armature | ( | ) | -> bool |
Definition at line 189 of file model_component.cpp.
void unravel::model_component::update_world_bounds | ( | const math::transform & | bounds | ) |
Definition at line 250 of file model_component.cpp.
|
noexcept |
Definition at line 305 of file model_component.cpp.