(NDK) Added NodeComponent
Former-commit-id: 61b970c31a12a1b128e72c4754590528b6c1b4d6
This commit is contained in:
21
SDK/include/NDK/Components/NodeComponent.inl
Normal file
21
SDK/include/NDK/Components/NodeComponent.inl
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <NDK/Entity.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
inline void NodeComponent::SetParent(Entity* entity, bool keepDerived)
|
||||
{
|
||||
if (entity)
|
||||
{
|
||||
NazaraAssert(entity->HasComponent<NodeComponent>(), "Entity must have a NodeComponent");
|
||||
|
||||
NzNode::SetParent(entity->GetComponent<NodeComponent>(), keepDerived);
|
||||
}
|
||||
else
|
||||
SetParent(nullptr, keepDerived);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user