#pragma once

#include "MaterialNode.h"

class SceneModel;
class AbstractMesh;

class MeshNode : public MaterialNode
{
public:
    MeshNode(const Transform& transform);
    virtual ~MeshNode();

    void setMesh(AbstractMesh* mesh);

    SceneItem* getSceneItem(std::size_t idx) const override;
    std::size_t getNumSceneItems() const override;

    void setWidth(double width);
    void setHeight(double height);

    void update(SceneInfo* sceneInfo) override;

private:
    bool mMeshIsDirty{true};
    AbstractMesh* mWorkingMesh{nullptr};

    double mWidth{1};
    double mHeight{1};
    std::unique_ptr<SceneModel> mModel;
};
