Sdk: Integrate particles
Former-commit-id: ff0535cb992dd9b09e67ea0affb74c50e9a5ff7f [formerly b91580468f5658ed265ec89e5c997d2ba8f26001] Former-commit-id: 76c852a32a56f98dbdefd9aab0c938e50408a5a5
This commit is contained in:
45
SDK/include/NDK/Components/ParticleEmitterComponent.hpp
Normal file
45
SDK/include/NDK/Components/ParticleEmitterComponent.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
// 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 <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*/)>;
|
||||
|
||||
ParticleEmitterComponent(Nz::ParticleGroup* group);
|
||||
ParticleEmitterComponent(const ParticleEmitterComponent& emitter);
|
||||
~ParticleEmitterComponent();
|
||||
|
||||
inline bool IsActive() const;
|
||||
|
||||
void SetActive(bool active = true);
|
||||
void SetGroup(Nz::ParticleGroup* group);
|
||||
inline void SetSetupFunc(SetupFunc func);
|
||||
|
||||
static ComponentIndex componentIndex;
|
||||
|
||||
private:
|
||||
void SetupParticles(Nz::ParticleMapper& mapper, unsigned int count) const override;
|
||||
|
||||
SetupFunc m_setupFunc;
|
||||
Nz::ParticleGroup* m_particleGroup;
|
||||
bool m_isActive;
|
||||
};
|
||||
}
|
||||
|
||||
#include <NDK/Components/ParticleEmitterComponent.inl>
|
||||
|
||||
#endif // NDK_COMPONENTS_PARTICLEEMITTERCOMPONENT_HPP
|
||||
#endif // NDK_SERVER
|
||||
Reference in New Issue
Block a user