They are no longer attached to groups, groups attach emitters Former-commit-id: c3a9f015dd46be1a4344c034ea2a191f0328acae [formerly 8e342bc0982853cf376535bf196e7ab8876301eb] [formerly b7c3afed37877838e2e7caefa28d7c1b4bf654a9 [formerly 886646b5d5f90b63b7af6942d693bdaab4db441d]] Former-commit-id: 85cb514f954ba68699022e73f7fbe1ad4cfd036e [formerly 6247fbfeb86c09464b27bfc11fa4a5e059d63065] Former-commit-id: 1d8badfef268dbdecdeda8ad91e988b3f936b865
46 lines
1.4 KiB
C++
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
|