#include "SceneItem.h"

SceneItem::SceneItem()
{

}

SceneItem::~SceneItem()
{

}

const Material* SceneItem::getMaterial() const
{
    if (mMaterial)
    {
        return mMaterial.get();
    }
    else
    {
        return &mSolidMaterial;
    }
}

const BasicMaterial& SceneItem::getSolidMaterial() const
{
    return mSolidMaterial;
}

const Transform& SceneItem::getTransform() const
{
    return mTransform;
}

const std::string& SceneItem::getName() const
{
    return mName;
}

bool SceneItem::isVisible() const
{
    return mIsVisible;
}

void SceneItem::setIsVisible(bool isVisible)
{
    mIsVisible = isVisible;
}

void SceneItem::updateSolidMaterial(const BasicMaterial& material)
{
    if (mSolidMaterial != material)
    {
        mMaterialIsDirty = true;
        mSolidMaterial = material;
    }
}

void SceneItem::updateTransform(const Transform& transform)
{
    if (mTransform != transform)
    {
        mTransformIsDirty = true;
        mTransform = transform;
    }
}

void SceneItem::setName(const std::string& name)
{
    mName = name;
}
