Graphics/Particles: Add wrappers on functions controller/generator/renderer

Former-commit-id: 05ad40899814194286c3f038362a58d788dca0d5 [formerly c592befc3a534a67dfe0554fd7bde86a736bbb91] [formerly 42f3c9d1e1dc9575277f225da71e29430ac096c6 [formerly 62c0d364d496348c476d8b88168e14b2da17d778]]
Former-commit-id: 8a4fa558e6bd09fbd55912f78dbb1bd0dcc2cb9d [formerly 94030181beae8c8d8dd4834e7373d470df8be56d]
Former-commit-id: 967bbd78527ac1fce82ab692b3bd19dda20df9c2
This commit is contained in:
Lynix
2016-08-14 17:54:37 +02:00
parent fa86f4345e
commit 3933af597f
9 changed files with 359 additions and 0 deletions

View 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);
}
}

View 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);
}
}

View 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);
}
}