Added (move) assignement operator to Model

Former-commit-id: eee1b92633656e47454218583f8e8bdabcddc157
This commit is contained in:
Lynix
2013-03-23 22:49:24 +01:00
parent 8f21a75c43
commit 7ddff94a30
2 changed files with 56 additions and 2 deletions

View File

@@ -533,6 +533,56 @@ void NzModel::SetSkinCount(unsigned int skinCount)
m_skinCount = skinCount;
}
NzModel& NzModel::operator=(const NzModel& node)
{
NzSceneNode::operator=(node);
m_animation = node.m_animation;
m_animationEnabled = node.m_animationEnabled;
m_boundingBox = node.m_boundingBox;
m_boundingBoxUpdated = node.m_boundingBoxUpdated;
m_currentFrame = node.m_currentFrame;
m_currentSequence = node.m_currentSequence;
m_drawEnabled = node.m_drawEnabled;
m_interpolation = node.m_interpolation;
m_matCount = node.m_matCount;
m_materials = node.m_materials;
m_mesh = node.m_mesh;
m_nextFrame = node.m_nextFrame;
m_skin = node.m_skin;
m_skinCount = node.m_skinCount;
if (m_mesh->GetAnimationType() == nzAnimationType_Skeletal)
m_skeleton = node.m_skeleton;
return *this;
}
NzModel& NzModel::operator=(NzModel&& node)
{
NzSceneNode::operator=(node);
m_animation = std::move(node.m_animation);
m_animationEnabled = node.m_animationEnabled;
m_boundingBox = node.m_boundingBox;
m_boundingBoxUpdated = node.m_boundingBoxUpdated;
m_currentFrame = node.m_currentFrame;
m_currentSequence = node.m_currentSequence;
m_drawEnabled = node.m_drawEnabled;
m_interpolation = node.m_interpolation;
m_matCount = node.m_matCount;
m_materials = std::move(node.m_materials);
m_mesh = std::move(node.m_mesh);
m_nextFrame = node.m_nextFrame;
m_skin = node.m_skin;
m_skinCount = node.m_skinCount;
if (m_mesh->GetAnimationType() == nzAnimationType_Skeletal)
m_skeleton = std::move(node.m_skeleton);
return *this;
}
void NzModel::Invalidate()
{
NzSceneNode::Invalidate();