1 #ifndef BLANK_MODEL_COMPOSITEMODEL_HPP_
2 #define BLANK_MODEL_COMPOSITEMODEL_HPP_
6 #include <glm/gtc/quaternion.hpp>
11 class DirectionalLighting;
14 class CompositeModel {
19 CompositeModel(const CompositeModel &) = delete;
20 CompositeModel &operator =(const CompositeModel &) = delete;
22 const glm::vec3 &Position() const noexcept { return position; }
23 void Position(const glm::vec3 &p) noexcept { position = p; }
25 const glm::quat &Orientation() const noexcept { return orientation; }
26 void Orientation(const glm::quat &o) noexcept { orientation = o; }
28 bool HasNodeModel() const noexcept { return node_model; }
29 void SetNodeModel(const EntityModel *m) noexcept { node_model = m; }
31 const EntityModel &NodeModel() const noexcept { return *node_model; }
33 CompositeModel &AddPart();
34 bool HasParent() const noexcept { return parent; }
35 CompositeModel &Parent() const noexcept { return *parent; }
36 bool IsRoot() const noexcept { return !HasParent(); }
38 glm::mat4 LocalTransform() const noexcept;
39 glm::mat4 GlobalTransform() const noexcept;
41 void Render(const glm::mat4 &, DirectionalLighting &) const;
44 CompositeModel *parent;
45 const EntityModel *node_model;
48 glm::quat orientation;
50 std::list<CompositeModel> parts;