4 #include <glm/gtc/quaternion.hpp>
13 class Transform :
public std::enable_shared_from_this<Transform> {
15 std::weak_ptr<Transform> parent;
16 std::list<std::shared_ptr<Transform>> children;
18 glm::vec3 local_translation;
19 glm::quat local_rotation;
20 glm::vec3 local_scale;
69 void addChild(std::shared_ptr<Transform> transform);
75 void removeChild(std::shared_ptr<Transform> transform);
82 std::list<std::shared_ptr<Transform>>
getChildren()
const;
88 std::shared_ptr<Transform>
getParent()
const;
103 void translate(
const float x,
const float y) noexcept;
111 void translate(
const float x,
const float y,
const float z) noexcept;
117 void translate(
const glm::vec3& vec) noexcept;
123 void translate(
const glm::vec2& vec) noexcept;
145 void rotate(
const float angle_x,
const float angle_y,
const float angle_z) noexcept;
151 void rotate(
const glm::vec3& euler_angles) noexcept;
157 void rotate(
const glm::quat& quat) noexcept;
164 void rotate(
const float angle,
const glm::vec3& axis) noexcept;
221 void scale(
const float x) noexcept;
228 void scale(
const float x,
const float y) noexcept;
236 void scale(
const float x,
const float y,
const float z) noexcept;
242 void scale(
const glm::vec2& vec) noexcept;
248 void scale(
const glm::vec3& vec) noexcept;