Move SDK include and source to base
This commit is contained in:
30
include/NazaraSDK/Components/NodeComponent.inl
Normal file
30
include/NazaraSDK/Components/NodeComponent.inl
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequisites.hpp
|
||||
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <NazaraSDK/Entity.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
/*!
|
||||
* \brief Sets the parent node of the entity
|
||||
*
|
||||
* \param entity Pointer to the entity considered as parent
|
||||
* \param keepDerived Should this component considered as a derived
|
||||
*
|
||||
* \remark Produces a NazaraAssert if entity has no component NodeComponent
|
||||
*/
|
||||
|
||||
inline void NodeComponent::SetParent(Entity* entity, bool keepDerived)
|
||||
{
|
||||
if (entity)
|
||||
{
|
||||
NazaraAssert(entity->HasComponent<NodeComponent>(), "Entity must have a NodeComponent");
|
||||
|
||||
Nz::Node::SetParent(entity->GetComponent<NodeComponent>(), keepDerived);
|
||||
}
|
||||
else
|
||||
Nz::Node::SetParent(nullptr, keepDerived);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user