Add second constructor to node
This commit is contained in:
@@ -14,6 +14,10 @@ namespace OpenVulkano::Scene
|
||||
Node::Node()
|
||||
: localMat(1), worldMat(1), enabled(true)
|
||||
{}
|
||||
|
||||
Node::Node(const Math::Matrix4f& pose)
|
||||
: localMat(pose), worldMat(pose), enabled(true)
|
||||
{}
|
||||
|
||||
Node::~Node() noexcept
|
||||
{
|
||||
|
||||
@@ -28,16 +28,18 @@ namespace OpenVulkano::Scene
|
||||
static constexpr DescriptorSetLayoutBinding DESCRIPTOR_SET_LAYOUT_BINDING = { 0, DescriptorSetLayoutBinding::Type::TYPE_UNIFORM_BUFFER_DYNAMIC, 1, ShaderProgramType::ALL_GRAPHICS };
|
||||
|
||||
Math::Matrix4f localMat, worldMat;
|
||||
bool enabled = true;
|
||||
Node* parent = nullptr;
|
||||
Scene* scene = nullptr;
|
||||
std::vector<Node*> children;
|
||||
std::vector<Drawable*> drawables;
|
||||
UpdateFrequency matrixUpdateFrequency = UpdateFrequency::Never;
|
||||
ICloseable* renderNode = nullptr;
|
||||
bool enabled = true;
|
||||
|
||||
public:
|
||||
Node();
|
||||
|
||||
Node(const Math::Matrix4f& pose);
|
||||
|
||||
~Node() noexcept override;
|
||||
|
||||
@@ -80,6 +82,8 @@ namespace OpenVulkano::Scene
|
||||
void Enable() { enabled = true; }
|
||||
|
||||
void Disable() { enabled = false; }
|
||||
|
||||
void SetEnabled(bool enable) { enabled = enable; }
|
||||
|
||||
[[nodiscard]] Node* GetParent() const { return parent; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user