// 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 #include 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(), "Entity must have a NodeComponent"); Nz::Node::SetParent(entity->GetComponent(), keepDerived); } else Nz::Node::SetParent(nullptr, keepDerived); } }