Unravel Engine C++ Reference
Loading...
Searching...
No Matches
transform_actions.h
Go to the documentation of this file.
1#pragma once
2
3#include "editing_action.h"
4#include "composite_action.h"
5#include "entt/meta/meta.hpp"
8#include <math/math.h>
9
10namespace unravel
11{
12
13// Individual transform component actions
14struct transform_move_action_t : crtp_meta_type<transform_move_action_t, editing_action_t>
15{
16 entt::handle entity;
17 math::vec3 old_position;
18 math::vec3 new_position;
19
20 transform_move_action_t(entt::handle ent, const math::vec3& old_pos, const math::vec3& new_pos);
21
22 void do_action() override;
23 void undo_action() override;
24 auto is_mergeable(const editing_action_t& previous) const -> bool override;
25 void merge_with(const editing_action_t& previous) override;
26 auto is_valid() const -> bool override;
27 void draw_in_inspector(rtti::context& ctx) override;
28};
29
31{
32 entt::handle entity;
33 math::vec3 old_position;
34 math::vec3 new_position;
35
36 transform_move_global_action_t(entt::handle ent, const math::vec3& old_pos, const math::vec3& new_pos);
37
38 void do_action() override;
39 void undo_action() override;
40 auto is_mergeable(const editing_action_t& previous) const -> bool override;
41 void merge_with(const editing_action_t& previous) override;
42 auto is_valid() const -> bool override;
43 void draw_in_inspector(rtti::context& ctx) override;
44};
45
47{
48 entt::handle entity;
49 math::quat old_rotation;
50 math::quat new_rotation;
51
52 transform_rotate_action_t(entt::handle ent, const math::quat& old_rot, const math::quat& new_rot);
53
54 void do_action() override;
55 void undo_action() override;
56 auto is_mergeable(const editing_action_t& previous) const -> bool override;
57 void merge_with(const editing_action_t& previous) override;
58 auto is_valid() const -> bool override;
59 void draw_in_inspector(rtti::context& ctx) override;
60};
61
63{
64 entt::handle entity;
65 math::vec3 old_scale;
66 math::vec3 new_scale;
67
68 transform_scale_action_t(entt::handle ent, const math::vec3& old_sc, const math::vec3& new_sc);
69
70 void do_action() override;
71 void undo_action() override;
72 auto is_mergeable(const editing_action_t& previous) const -> bool override;
73 void merge_with(const editing_action_t& previous) override;
74 auto is_valid() const -> bool override;
75 void draw_in_inspector(rtti::context& ctx) override;
76};
77
79{
80 entt::handle entity;
81 math::vec3 old_skew;
82 math::vec3 new_skew;
83
84 transform_skew_action_t(entt::handle ent, const math::vec3& old_sk, const math::vec3& new_sk);
85
86 void do_action() override;
87 void undo_action() override;
88 auto is_mergeable(const editing_action_t& previous) const -> bool override;
89 void merge_with(const editing_action_t& previous) override;
90 auto is_valid() const -> bool override;
91 void draw_in_inspector(rtti::context& ctx) override;
92};
93
94
95} // namespace unravel
auto is_valid() const -> bool override
void draw_in_inspector(rtti::context &ctx) override
transform_move_action_t(entt::handle ent, const math::vec3 &old_pos, const math::vec3 &new_pos)
void merge_with(const editing_action_t &previous) override
auto is_mergeable(const editing_action_t &previous) const -> bool override