Graphics/Particles: Add wrappers on functions controller/generator/renderer
Former-commit-id: b4bc65fd61d304ab9c54f5eb960ee3ee111e4199 [formerly 6dc8ec4c126ec92253fcd1488f3d450a87cd2b0b] [formerly 72c62a62a1f34b633531c8e011e697a773ba574a [formerly d2aff554d20246c1fc5b47013e3e7c136c0b51a2]] Former-commit-id: 54227b0f67e85ff186ec4ee7a3df0f3aa70193d1 [formerly 49065827d43b04e836901c05fee0542667c50683] Former-commit-id: 013776ab4b91064bb48b18822317935376062a09
This commit is contained in:
29
src/Nazara/Graphics/ParticleFunctionController.cpp
Normal file
29
src/Nazara/Graphics/ParticleFunctionController.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/ParticleFunctionController.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \ingroup graphics
|
||||
* \class Nz::ParticleFunctionController
|
||||
* \brief Helper class used to provide a function as a particle controller without going in the process of making a new class
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Calls the controller function
|
||||
*
|
||||
* \param group Particle group responsible of the particles
|
||||
* \param mapper Particle mapper, allowing access to the particle data
|
||||
* \param startId The first ID of the particle to update (inclusive)
|
||||
* \param endId The last ID of the particle to update (inclusive)
|
||||
* \param elapsedTime Elapsed time in seconds since the last update
|
||||
*/
|
||||
void ParticleFunctionController::Apply(ParticleGroup& group, ParticleMapper& mapper, unsigned int startId, unsigned int endId, float elapsedTime)
|
||||
{
|
||||
m_controller(group, mapper, startId, endId, elapsedTime);
|
||||
}
|
||||
}
|
||||
28
src/Nazara/Graphics/ParticleFunctionGenerator.cpp
Normal file
28
src/Nazara/Graphics/ParticleFunctionGenerator.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/ParticleFunctionGenerator.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \ingroup graphics
|
||||
* \class Nz::ParticleFunctionGenerator
|
||||
* \brief Helper class used to provide a function as a particle generator without going in the process of making a new class
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Calls the generator function
|
||||
*
|
||||
* \param group Particle group responsible of the particles
|
||||
* \param mapper Particle mapper, allowing access to the particle data
|
||||
* \param startId The first ID of the particle to update (inclusive)
|
||||
* \param endId The last ID of the particle to update (inclusive)
|
||||
*/
|
||||
void ParticleFunctionGenerator::Generate(ParticleGroup& group, ParticleMapper& mapper, unsigned int startId, unsigned int endId)
|
||||
{
|
||||
m_generator(group, mapper, startId, endId);
|
||||
}
|
||||
}
|
||||
29
src/Nazara/Graphics/ParticleFunctionRenderer.cpp
Normal file
29
src/Nazara/Graphics/ParticleFunctionRenderer.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/ParticleFunctionRenderer.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \ingroup graphics
|
||||
* \class Nz::ParticleFunctionRenderer
|
||||
* \brief Helper class used to provide a function as a particle renderer without going in the process of making a new class
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Calls the renderer function
|
||||
*
|
||||
* \param group Particle group responsible of the particles
|
||||
* \param mapper Particle mapper, allowing constant access to the particle data
|
||||
* \param startId The first ID of the particle to update (inclusive)
|
||||
* \param endId The last ID of the particle to update (inclusive)
|
||||
* \param renderQueue The concerned render queue that will receive drawable informations
|
||||
*/
|
||||
void ParticleFunctionRenderer::Render(const ParticleGroup& group, const ParticleMapper& mapper, unsigned int startId, unsigned int endId, AbstractRenderQueue* renderQueue)
|
||||
{
|
||||
m_renderer(group, mapper, startId, endId, renderQueue);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user