Files
NazaraEngine/SDK/include/NDK/Components/ParticleEmitterComponent.hpp
Lynix 7f707e1250 Sdk/ParticleEmitterComponent: Update emitter (they are no longer attached to groups)
They are no longer attached to groups, groups attach emitters


Former-commit-id: fa4c2eb69147c7a19e9d77f952fdeaec0fdafc24 [formerly 981a7cfe37867842b4fe275cae6b04ab9f8a33c9] [formerly bc3c128bdfdb36eaf09f8f8a650c07e00d7e877c [formerly 1dc92772e589d80f59e8dab5d315387c7c57f886]]
Former-commit-id: 6420a724b368ab2e72e67154e76566c7eda9f7a5 [formerly b3912e18e589bff75f8f9a1870fbebffe208f653]
Former-commit-id: 1598b8cfb892285daee6dac7cd3283ba8447a032
2016-08-06 01:09:13 +02:00

46 lines
1.4 KiB
C++

// 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
#pragma once
#ifndef NDK_SERVER
#ifndef NDK_COMPONENTS_PARTICLEEMITTERCOMPONENT_HPP
#define NDK_COMPONENTS_PARTICLEEMITTERCOMPONENT_HPP
#include <Nazara/Graphics/ParticleEmitter.hpp>
#include <Nazara/Graphics/ParticleGroup.hpp>
#include <NDK/Component.hpp>
namespace Ndk
{
class NDK_API ParticleEmitterComponent : public Component<ParticleEmitterComponent>, public Nz::ParticleEmitter
{
public:
using SetupFunc = std::function<void(const EntityHandle& /*entity*/, Nz::ParticleMapper& /*mapper*/, unsigned int /*count*/)>;
inline ParticleEmitterComponent();
ParticleEmitterComponent(const ParticleEmitterComponent& emitter) = default;
ParticleEmitterComponent(ParticleEmitterComponent&& emitter) = default;
~ParticleEmitterComponent() = default;
void Enable(bool active = true);
inline bool IsActive() const;
inline void SetSetupFunc(SetupFunc func);
static ComponentIndex componentIndex;
private:
void SetupParticles(Nz::ParticleMapper& mapper, unsigned int count) const override;
SetupFunc m_setupFunc;
bool m_isActive;
};
}
#include <NDK/Components/ParticleEmitterComponent.inl>
#endif // NDK_COMPONENTS_PARTICLEEMITTERCOMPONENT_HPP
#endif // NDK_SERVER