Toast Engine
Loading...
Searching...
No Matches
mesh_node.hpp
Go to the documentation of this file.
1
8
9#pragma once
10#include "node_3d.hpp"
11
12#include <algorithm>
13#include <array>
14#include <span>
17
18namespace assets {
19class Mesh;
20class Material;
21}
22
23namespace toast {
24class [[ToastNode, Icon("MeshItem")]] TOAST_API MeshNode : public Node3D {
25public:
26 MeshNode() = default;
27
28 MeshNode(assets::Handle<assets::Mesh> mesh) : m_mesh(std::move(mesh)) { }
29
31 : m_mesh(std::move(mesh)),
32 m_material(std::move(material)) { }
33
34 auto worldTransformForRender() -> const glm::mat4& { return getWorldTransform(); }
35
36 [[nodiscard]]
37 auto getMesh() const -> const assets::Handle<assets::Mesh>& {
38 return m_mesh;
39 }
40
41 [[nodiscard]]
42 auto getMesh() -> assets::Handle<assets::Mesh>& {
43 return m_mesh;
44 }
45
46 [[nodiscard]]
47 auto getMaterial() const -> const assets::Handle<assets::Material>& {
48 return m_material;
49 }
50
51 [[nodiscard]]
52 auto getMaterial() -> assets::Handle<assets::Material>& {
53 return m_material;
54 }
55
64 [[nodiscard]]
65 auto getSkinAnimation() const -> const assets::Handle<assets::Animation>& {
66 return m_skin_animation;
67 }
68
70 [[nodiscard]]
71 auto getSkinName() const -> const std::string& {
72 return m_skin_name;
73 }
74
75private:
76 void updateInspectorMessages() override;
77 void init();
78 void end();
79 void destroy();
80
81 [[Reflect]]
83
84 [[Reflect]]
86
87 [[Reflect, Name("Skin Animation")]]
88 assets::Handle<assets::Animation> m_skin_animation;
89
90 [[Reflect, Name("Skin Name")]]
91 std::string m_skin_name;
92
93 bool m_registered_proxy = false;
94};
95}
Keyframe animation asset (.tanim), imported from glTF.
Type-safe smart pointer for assets.
Definition core_types.hpp:149
Shader-driven material asset.
Definition material.hpp:49
Definition mesh.hpp:66
auto getSkinName() const -> const std::string &
Definition mesh_node.hpp:71
auto getSkinAnimation() const -> const assets::Handle< assets::Animation > &
Which .tanim asset's Skin drives this mesh, if it's skinned.
Definition mesh_node.hpp:65
Definition node_3d.hpp:25
Definition reflect.hpp:244
Node with 3D spatial transforms.
Concrete asset types for the Toast engine.