Hymn to Beauty
C++ 3D Engine
Shape.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include "SuperComponent.hpp"
5
7
8namespace Physics {
9class Shape;
10}
11
12namespace Component {
15class Shape : public SuperComponent {
16 friend class ::PhysicsManager;
17
18 public:
20 Shape() = default;
21
22 void Serialize(Json::Value& node, bool load) override;
23
25
28 std::shared_ptr<::Physics::Shape> GetShape() const;
29
30 private:
31 // Set the shape that this component will represent.
32 void SetShape(std::shared_ptr<::Physics::Shape> shape);
33 Json::Value Save() const;
34 void Load(Json::Value& node);
35
36 std::shared_ptr<::Physics::Shape> shape = nullptr;
37};
38} // namespace Component
Definition: Shape.hpp:15
Shape()=default
Create new shape.
void Serialize(Json::Value &node, bool load) override
Save or load component values to/from JSON.
Definition: Shape.cpp:14
std::shared_ptr<::Physics::Shape > GetShape() const
Get the shape this component represents.
Definition: Shape.cpp:22
Component which all components inherit.
Definition: SuperComponent.hpp:9
Updates the physics of the world.
Definition: PhysicsManager.hpp:28
Definition: BoxShapeEditor.hpp:5
Definition: IShapeEditor.hpp:7