6#include "entt/meta/meta.hpp"
7#include "entt/meta/resolve.hpp"
20 [](
const entt::meta_any& i)
25 entt::meta_factory<math::transform>{}
57 entt::meta_factory<transform_component>{}
58 .type(
"transform_component"_hs)
74 "It is relative to the parent."},
76 .data<&transform_component::set_transform_global, &transform_component::get_transform_global>(
"global_transform"_hs)
81 "Affected by parent transformation."},
83 .data<&transform_component::set_active, &transform_component::is_active>(
"active"_hs)
103 try_save(ar, ser20::make_nvp(
"local_transform", obj.get_transform_local()));
104 try_save(ar, ser20::make_nvp(
"parent", is_root ? entt::handle{} : obj.get_parent()));
105 try_save(ar, ser20::make_nvp(
"children", obj.get_children()));
106 try_save(ar, ser20::make_nvp(
"active", obj.is_active()));
114 if(
try_load(ar, ser20::make_nvp(
"local_transform", local_transform)))
116 obj.set_transform_local(local_transform);
120 try_load(ar, ser20::make_nvp(
"parent", parent));
122 obj.set_parent(parent,
false);
125 std::vector<entt::handle> children;
126 try_load(ar, ser20::make_nvp(
"children", children));
129 if(
try_load(ar, ser20::make_nvp(
"active", active)))
131 obj.set_active(active);
attributes::value_type attribute
std::map< std::string, meta_any > attributes
auto property_predicate(property_predicate_t predicate) -> property_predicate_t
BinaryInputArchive iarchive_binary_t
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
#define SAVE_INSTANTIATE(cls, Archive)
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
Root component structure for the ACE framework, serves as the base component.