Voxellancer
0.3
A game about voxels in space
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Pages
voxelparticleremover.h
1
#pragma once
2
3
#include <memory>
4
#include <list>
5
6
#include "property/property.h"
7
8
9
template
<
typename
T>
10
class
ThreadPool
;
11
12
class
Player
;
13
struct
VoxelParticleData
;
14
class
VoxelParticleEngine
;
15
class
VoxelParticleRemoveCheck
;
16
17
/*
18
Check that is guaranteed to be performed on every particle once in a
19
specific interval. If check() returns true the particle is marked as dead
20
and the space in the buffer may be used again for a new particle
21
*/
22
class
VoxelParticleRemover
{
23
public
:
24
VoxelParticleRemover
(
VoxelParticleEngine
* world);
25
~
VoxelParticleRemover
();
26
27
void
addCheck(std::shared_ptr<VoxelParticleRemoveCheck> checker);
28
29
void
setPlayer(
Player
& player);
30
31
float
interval()
const
;
32
void
setInterval(
float
interval);
33
34
virtual
void
update(
float
deltaSec);
35
36
37
protected
:
38
VoxelParticleEngine
* m_particleEngine;
39
std::vector<std::shared_ptr<VoxelParticleRemoveCheck>> m_checker;
40
std::unique_ptr<ThreadPool<VoxelParticleData>> m_threadPool;
41
42
Property<float>
m_interval;
43
Property<bool>
m_multithreaded;
44
45
int
m_currentIndex;
46
47
void
performChecks(
int
checkCount);
48
bool
isDead(
VoxelParticleData
& particle);
49
void
beforeCheck();
50
};
51
VoxelParticleData
Definition:
voxelparticledata.h:7
VoxelParticleRemoveCheck
Definition:
voxelparticleremovecheck.h:6
VoxelParticleEngine
Definition:
voxelparticleengine.h:23
VoxelParticleRemover
Definition:
voxelparticleremover.h:22
ThreadPool
Definition:
threadpool.h:16
Property< float >
Player
Definition:
player.h:22
src
voxeleffect
particlechecks
voxelparticleremover.h
Generated on Sun Mar 30 2014 13:32:32 for Voxellancer by
1.8.6