29auto internal_m2n_get_children(entt::entity
id) -> hpp::small_vector<entt::entity>
33 const auto&
children = comp->get_children();
34 hpp::small_vector<entt::entity> children_id;
35 children_id.reserve(
children.size());
38 children_id.emplace_back(child.entity());
53auto internal_m2n_get_child(entt::entity
id,
const std::string& path,
bool recursive) -> entt::entity
56 if(!root || path.empty())
65 hpp::small_vector<node_candidate>
queue;
67 queue.push_back({root, 0});
70 for(
size_t idx = 0; idx <
queue.size(); ++idx)
72 auto candidate =
queue[idx];
73 bool advanced =
false;
76 if(candidate.matched_index < parts.size())
80 if(tag_comp->name == parts[candidate.matched_index])
82 candidate.matched_index++;
84 if(candidate.matched_index == parts.size())
86 return candidate.entity;
95 bool should_enqueue = recursive ? (candidate.matched_index == 0 || advanced) : (candidate.
matched_index == 0);
101 for(
const auto& child : trans_comp->get_children())
103 queue.push_back({child.entity(), candidate.matched_index});
112auto internal_m2n_get_parent(entt::entity
id) -> entt::entity
116 return comp->get_parent().entity();
122void internal_m2n_set_parent(entt::entity
id, entt::entity new_parent,
bool global_stays)
127 comp->set_parent(parent, global_stays);
131auto internal_m2n_get_position_global(entt::entity
id) -> math::vec3
135 return comp->get_position_global();
141void internal_m2n_set_position_global(entt::entity
id,
const math::vec3& value)
145 comp->set_position_global(value);
149void internal_m2n_move_by_global(entt::entity
id,
const math::vec3& value)
153 comp->move_by_global(value);
157auto internal_m2n_get_position_local(entt::entity
id) -> math::vec3
161 return comp->get_position_local();
167void internal_m2n_set_position_local(entt::entity
id,
const math::vec3& value)
171 comp->set_position_local(value);
175void internal_m2n_move_by_local(entt::entity
id,
const math::vec3& value)
179 comp->move_by_local(value);
184auto internal_m2n_get_rotation_euler_global(entt::entity
id) -> math::vec3
188 return comp->get_rotation_euler_global();
194void internal_m2n_rotate_by_euler_global(entt::entity
id,
const math::vec3& amount)
198 comp->rotate_by_euler_global(amount);
202void internal_m2n_rotate_axis_global(entt::entity
id,
float degrees,
const math::vec3& axis)
206 comp->rotate_axis_global(degrees, axis);
210auto internal_m2n_transform_vector_global(entt::entity
id,
const math::vec3& coord) -> math::vec3
214 const auto&
global = comp->get_transform_global();
215 return global.transform_coord(coord);
221auto internal_m2n_inverse_transform_vector_global(entt::entity
id,
const math::vec3& coord) -> math::vec3
225 const auto&
global = comp->get_transform_global();
226 return global.inverse_transform_coord(coord);
232auto internal_m2n_transform_direction_global(entt::entity
id,
const math::vec3& direction) -> math::vec3
236 const auto&
global = comp->get_transform_global();
237 return global.transform_normal(direction);
243auto internal_m2n_inverse_transform_direction_global(entt::entity
id,
const math::vec3& direction) -> math::vec3
247 const auto&
global = comp->get_transform_global();
248 return global.inverse_transform_normal(direction);
254void internal_m2n_look_at(entt::entity
id,
const math::vec3&
point,
const math::vec3& up)
258 comp->look_at(
point, up);
262void internal_m2n_set_rotation_euler_global(entt::entity
id,
const math::vec3& value)
266 comp->set_rotation_euler_global(value);
270auto internal_m2n_get_rotation_euler_local(entt::entity
id) -> math::vec3
274 return comp->get_rotation_euler_local();
280void internal_m2n_set_rotation_euler_local(entt::entity
id,
const math::vec3& value)
284 comp->set_rotation_euler_local(value);
288void internal_m2n_rotate_by_euler_local(entt::entity
id,
const math::vec3& amount)
292 comp->rotate_by_euler_local(amount);
296auto internal_m2n_get_rotation_global(entt::entity
id) -> math::quat
300 return comp->get_rotation_global();
306void internal_m2n_set_rotation_global(entt::entity
id,
const math::quat& value)
310 comp->set_rotation_global(value);
314void internal_m2n_rotate_by_global(entt::entity
id,
const math::quat& amount)
318 comp->rotate_by_global(amount);
322auto internal_m2n_get_rotation_local(entt::entity
id) -> math::quat
326 return comp->get_rotation_local();
332void internal_m2n_set_rotation_local(entt::entity
id,
const math::quat& value)
336 comp->set_rotation_local(value);
340void internal_m2n_rotate_by_local(entt::entity
id,
const math::quat& amount)
344 comp->rotate_by_local(amount);
349auto internal_m2n_get_scale_global(entt::entity
id) -> math::vec3
353 return comp->get_scale_global();
359void internal_m2n_set_scale_global(entt::entity
id,
const math::vec3& value)
363 comp->set_scale_global(value);
367void internal_m2n_scale_by_global(entt::entity
id,
const math::vec3& amount)
371 comp->scale_by_global(amount);
375auto internal_m2n_get_scale_local(entt::entity
id) -> math::vec3
379 return comp->get_scale_local();
385void internal_m2n_set_scale_local(entt::entity
id,
const math::vec3& value)
389 comp->set_scale_local(value);
393void internal_m2n_scale_by_local(entt::entity
id,
const math::vec3& amount)
397 comp->scale_by_local(amount);
402auto internal_m2n_get_skew_global(entt::entity
id) -> math::vec3
406 return comp->get_skew_global();
412void internal_m2n_setl_skew_globa(entt::entity
id,
const math::vec3& value)
416 comp->set_skew_global(value);
420auto internal_m2n_get_skew_local(entt::entity
id) -> math::vec3
424 return comp->get_skew_local();
430void internal_m2n_set_skew_local(entt::entity
id,
const math::vec3& value)
434 comp->set_skew_local(value);
444 auto reg = dotnet::internal_call_registry(
"Unravel.Core.TransformComponent");
445 reg.add_internal_call(
"internal_m2n_get_children", dotnet_internal_call(internal_m2n_get_children));
446 reg.add_internal_call(
"internal_m2n_get_child", dotnet_internal_call(internal_m2n_get_child));
447 reg.add_internal_call(
"internal_m2n_get_parent", dotnet_internal_call(internal_m2n_get_parent));
448 reg.add_internal_call(
"internal_m2n_set_parent", dotnet_internal_call(internal_m2n_set_parent));
450 reg.add_internal_call(
"internal_m2n_get_position_global", dotnet_internal_call(internal_m2n_get_position_global));
451 reg.add_internal_call(
"internal_m2n_set_position_global", dotnet_internal_call(internal_m2n_set_position_global));
452 reg.add_internal_call(
"internal_m2n_move_by_global", dotnet_internal_call(internal_m2n_move_by_global));
454 reg.add_internal_call(
"internal_m2n_get_position_local", dotnet_internal_call(internal_m2n_get_position_local));
455 reg.add_internal_call(
"internal_m2n_set_position_local", dotnet_internal_call(internal_m2n_set_position_local));
456 reg.add_internal_call(
"internal_m2n_move_by_local", dotnet_internal_call(internal_m2n_move_by_local));
459 reg.add_internal_call(
"internal_m2n_get_rotation_euler_global",
460 dotnet_internal_call(internal_m2n_get_rotation_euler_global));
461 reg.add_internal_call(
"internal_m2n_set_rotation_euler_global",
462 dotnet_internal_call(internal_m2n_set_rotation_euler_global));
463 reg.add_internal_call(
"internal_m2n_rotate_by_euler_global",
464 dotnet_internal_call(internal_m2n_rotate_by_euler_global));
466 reg.add_internal_call(
"internal_m2n_get_rotation_euler_local",
467 dotnet_internal_call(internal_m2n_get_rotation_euler_local));
468 reg.add_internal_call(
"internal_m2n_set_rotation_euler_local",
469 dotnet_internal_call(internal_m2n_set_rotation_euler_local));
470 reg.add_internal_call(
"internal_m2n_rotate_by_euler_local", dotnet_internal_call(internal_m2n_rotate_by_euler_local));
473 reg.add_internal_call(
"internal_m2n_get_rotation_global", dotnet_internal_call(internal_m2n_get_rotation_global));
474 reg.add_internal_call(
"internal_m2n_set_rotation_global", dotnet_internal_call(internal_m2n_set_rotation_global));
475 reg.add_internal_call(
"internal_m2n_rotate_by_global", dotnet_internal_call(internal_m2n_rotate_by_global));
477 reg.add_internal_call(
"internal_m2n_get_rotation_local", dotnet_internal_call(internal_m2n_get_rotation_local));
478 reg.add_internal_call(
"internal_m2n_set_rotation_local", dotnet_internal_call(internal_m2n_set_rotation_local));
479 reg.add_internal_call(
"internal_m2n_rotate_by_local", dotnet_internal_call(internal_m2n_rotate_by_local));
482 reg.add_internal_call(
"internal_m2n_rotate_axis_global", dotnet_internal_call(internal_m2n_rotate_axis_global));
483 reg.add_internal_call(
"internal_m2n_look_at", dotnet_internal_call(internal_m2n_look_at));
484 reg.add_internal_call(
"internal_m2n_transform_vector_global",
485 dotnet_internal_call(internal_m2n_transform_vector_global));
486 reg.add_internal_call(
"internal_m2n_inverse_transform_vector_global",
487 dotnet_internal_call(internal_m2n_inverse_transform_vector_global));
489 reg.add_internal_call(
"internal_m2n_transform_direction_global",
490 dotnet_internal_call(internal_m2n_transform_direction_global));
491 reg.add_internal_call(
"internal_m2n_inverse_transform_direction_global",
492 dotnet_internal_call(internal_m2n_inverse_transform_direction_global));
495 reg.add_internal_call(
"internal_m2n_get_scale_global", dotnet_internal_call(internal_m2n_get_scale_global));
496 reg.add_internal_call(
"internal_m2n_set_scale_global", dotnet_internal_call(internal_m2n_set_scale_global));
497 reg.add_internal_call(
"internal_m2n_scale_by_global", dotnet_internal_call(internal_m2n_scale_by_local));
499 reg.add_internal_call(
"internal_m2n_get_scale_local", dotnet_internal_call(internal_m2n_get_scale_local));
500 reg.add_internal_call(
"internal_m2n_set_scale_local", dotnet_internal_call(internal_m2n_set_scale_local));
501 reg.add_internal_call(
"internal_m2n_scale_by_local", dotnet_internal_call(internal_m2n_scale_by_local));
504 reg.add_internal_call(
"internal_m2n_get_skew_global", dotnet_internal_call(internal_m2n_get_skew_global));
505 reg.add_internal_call(
"internal_m2n_set_skew_globa", dotnet_internal_call(internal_m2n_setl_skew_globa));
506 reg.add_internal_call(
"internal_m2n_get_skew_local", dotnet_internal_call(internal_m2n_get_skew_local));
507 reg.add_internal_call(
"internal_m2n_set_skew_local", dotnet_internal_call(internal_m2n_set_skew_local));
#define APPLOG_TRACE(...)
auto queue(seq_action action, const seq_scope_policy &scope_policy, hpp::source_location location) -> seq_id_t
Queues a new action.
auto tokenize(const std::string &str, const std::string &delimiters) -> string_tokens_t
void register_transform_component_script_bindings()
auto get_entity_from_id(entt::entity id) -> entt::handle
auto safe_get_component(entt::entity id) -> T *