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


Former-commit-id: 9a586151ac4ce932cda5d6c36c3e40718aef7f2c [formerly 830dd96bb020bec7dc7b652acca43fdef2d01971] [formerly 26cf67777c40ca4a6bcc0643a8dea76d46debd30 [formerly d4d7e62390be2a4d44b5a67c5fbabc11aa080de5]]
Former-commit-id: 653b321e01aa182a3dcb0531319cb9a053aadfa8 [formerly c4e742f3aab61f0941729a5739a80a838c6163cd]
Former-commit-id: 6572d614b19d85cbc0844745c45c3bc92deef051
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