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:
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