Voxellancer
0.3
A game about voxels in space
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Pages
voxelparticleengine.h
1
#pragma once
2
3
#include <memory>
4
#include <vector>
5
#include <stack>
6
7
#include "etc/contextdependant.h"
8
9
#include "property/property.h"
10
11
class
Player
;
12
class
Camera
;
13
struct
VoxelParticleData
;
14
class
VoxelParticleSetup
;
15
class
VoxelParticleRenderer
;
16
class
VoxelParticleRemover
;
17
class
VoxelCluster
;
18
19
/*
20
Main class for managing and displaying the VoxelParticles of
21
a World.
22
*/
23
class
VoxelParticleEngine
:
ContextDependant
{
24
public
:
25
VoxelParticleEngine
();
26
~
VoxelParticleEngine
();
27
28
float
time()
const
;
29
30
int
particleCount()
const
;
31
int
particleDataCount()
const
;
32
VoxelParticleData
* particleData(
int
index);
33
std::vector<VoxelParticleData>& particleDataVector();
34
35
void
addParticle(
const
VoxelParticleSetup
& particleSetup,
const
VoxelCluster
* creator);
36
void
removeParticle(
int
index);
37
38
void
update(
float
deltaSec);
39
void
draw(
const
Camera
& camera);
40
41
protected
:
42
float
m_time;
43
bool
m_initialized;
44
45
std::unique_ptr<VoxelParticleRenderer> m_renderer;
46
std::unique_ptr<VoxelParticleRemover> m_remover;
47
48
std::vector<VoxelParticleData> m_cpuParticleBuffer;
49
std::stack<int> m_freeParticleBufferIndices;
50
51
bool
m_gpuParticleBufferInvalid;
52
int
m_gpuParticleBufferInvalidBegin;
53
int
m_gpuParticleBufferInvalidEnd;
54
55
void
setBufferSize(
int
bufferSize);
56
void
particleChanged(
int
bufferIndex);
57
void
updateGPUBuffers(
int
begin,
int
end);
58
59
virtual
void
beforeContextDestroy();
60
virtual
void
afterContextRebuild();
61
62
};
63
VoxelParticleData
Definition:
voxelparticledata.h:7
ContextDependant
Definition:
contextdependant.h:7
VoxelParticleEngine
Definition:
voxelparticleengine.h:23
VoxelCluster
Definition:
voxelcluster.h:21
VoxelParticleRenderer
Definition:
voxelparticlerenderer.h:27
Camera
Definition:
camera.h:10
VoxelParticleRemover
Definition:
voxelparticleremover.h:22
Player
Definition:
player.h:22
VoxelParticleSetup
Definition:
voxelparticlesetup.h:17
src
voxeleffect
voxelparticleengine.h
Generated on Sun Mar 30 2014 13:32:32 for Voxellancer by
1.8.6