Kinetic Visualization (Visualisierung 2 - S2012)
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
src
vis2
vis2
Particle.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <vlCore/Vector3.hpp>
4
#include <vlCore/Matrix4.hpp>
5
#include <vlCore/Image.hpp>
6
#include "
ParticleMap.h
"
7
#include "
Globals.h
"
8
9
#include <vector>
10
12
15
class
Particle
16
{
17
public
:
27
Particle
(
const
vl::vec3 &
pos
,
const
vl::vec3 &dir,
int
w,
int
h,
int
d);
28
~Particle
(
void
);
29
52
void
prepareUpdate
(
53
vl::ref<vl::Image> image, vl::ref<vl::Image>
gradient
, vl::ref<vl::Image>
curvature
,
ParticleMap
&map,
54
const
std::vector<vl::vec3> &candidatePositions,
55
std::vector<bool> &spawnMap,
56
// curvature
57
float
kC,
58
// flocking
59
float
kF,
float
flockSigma,
60
// user preferred direction
61
float
kD,
const
vl::vec3 &userDir,
62
// repulsion
63
float
kR,
float
sigmaRepulse,
64
// particle dying
65
bool
enableDying,
float
crowdedThreshold,
float
crowdedSigma,
int
dyingNeighborhood,
66
// global stuff
67
float
density,
bool
stick);
71
void
updateMap
(
ParticleMap
&map,
float
dt);
75
void
addToMap
(
ParticleMap
&map);
79
void
update
(
float
dt);
80
84
vl::vec3
getDirection
()
const
{
return
_direction
; }
85
89
vl::vec3
getPosition
()
const
{
return
_position
; }
90
94
vl::vec3
getWorldPosition
()
const
;
95
private
:
96
bool
outOfBounds
(
const
vl::vec3 &dir)
const
;
97
99
vl::vec3
_position
;
101
vl::vec3
_direction
;
103
vl::vec3
_nextDirection
;
105
int
_width
;
107
int
_height
;
109
int
_depth
;
110
112
vl::vec3
_nextPosition
;
114
bool
_wasDeath
;
115
};
116
Generated on Tue Jun 12 2012 15:05:37 for Kinetic Visualization (Visualisierung 2 - S2012) by
1.8.1