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

Former-commit-id: 8a0eab88a918f901e918a81cc8a81906167eccb8 [formerly 1fea24282314656473187fd5320f36eb6d06c004] [formerly ec24ee686b68f7e684853d49772105bc5a92b5a0 [formerly e9d6783dd6dff1de2468bd0fd979b28037b1cb44]]
Former-commit-id: fc6ad0e1dbf563f3b3b485fe9c7f93b35c0712bc [formerly 9cfcb29a154a3461183695df3daccbb8965eaee9]
Former-commit-id: b91d72a005fdb104711fb8892b14a5f98fc29ab3
This commit is contained in:
Lynix
2016-08-14 17:54:37 +02:00
parent 31c1ecf2d9
commit 262f4c2a87
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);
}
}