1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (c) 2004-2013 HUBzero Foundation, LLC |
---|
4 | * |
---|
5 | */ |
---|
6 | #ifndef PARTICLEEMITTER_H |
---|
7 | #define PARTICLEEMITTER_H |
---|
8 | |
---|
9 | #include <string> |
---|
10 | |
---|
11 | #include <vrmath/Vector3f.h> |
---|
12 | |
---|
13 | class ParticleEmitter |
---|
14 | { |
---|
15 | public: |
---|
16 | ParticleEmitter(); |
---|
17 | |
---|
18 | void setName(const std::string& name); |
---|
19 | void setPosition(float x, float y, float z); |
---|
20 | void setMinMaxLifeTime(float minLifeTime, float maxLifeTime); |
---|
21 | void setMaxPositionOffset(float offsetX, float offsetY, float offsetZ); |
---|
22 | void setMinMaxNumOfNewParticles(int minNum, int maxNum); |
---|
23 | |
---|
24 | void setVectorField(); |
---|
25 | void setEnabled(bool enabled); |
---|
26 | bool isEnabled() const; |
---|
27 | |
---|
28 | std::string _name; |
---|
29 | vrmath::Vector3f _position; |
---|
30 | |
---|
31 | vrmath::Vector3f _oldPosition; |
---|
32 | |
---|
33 | float _minLifeTime; |
---|
34 | float _maxLifeTime; |
---|
35 | |
---|
36 | // [0..1] * _maxPositionOffset; |
---|
37 | vrmath::Vector3f _maxPositionOffset; |
---|
38 | |
---|
39 | int _minNumOfNewParticles; |
---|
40 | int _maxNumOfNewParticles; |
---|
41 | |
---|
42 | bool _enabled; |
---|
43 | }; |
---|
44 | |
---|
45 | inline void ParticleEmitter::setName(const std::string& name) |
---|
46 | { |
---|
47 | _name = name; |
---|
48 | } |
---|
49 | |
---|
50 | inline void ParticleEmitter::setPosition(float x, float y, float z) |
---|
51 | { |
---|
52 | _position.x = x; |
---|
53 | _position.y = y; |
---|
54 | _position.z = z; |
---|
55 | } |
---|
56 | |
---|
57 | inline void ParticleEmitter::setMinMaxLifeTime(float minLifeTime, float maxLifeTime) |
---|
58 | { |
---|
59 | _minLifeTime = minLifeTime; |
---|
60 | _maxLifeTime = maxLifeTime; |
---|
61 | } |
---|
62 | |
---|
63 | inline void ParticleEmitter::setMaxPositionOffset(float offsetX, float offsetY, float offsetZ) |
---|
64 | { |
---|
65 | _maxPositionOffset.x = offsetX; |
---|
66 | _maxPositionOffset.y = offsetY; |
---|
67 | _maxPositionOffset.z = offsetZ; |
---|
68 | } |
---|
69 | |
---|
70 | inline void ParticleEmitter::setMinMaxNumOfNewParticles(int minNum, int maxNum) |
---|
71 | { |
---|
72 | _minNumOfNewParticles = minNum; |
---|
73 | _maxNumOfNewParticles = maxNum; |
---|
74 | } |
---|
75 | |
---|
76 | inline void ParticleEmitter::setEnabled(bool enabled) |
---|
77 | { |
---|
78 | _enabled = enabled; |
---|
79 | } |
---|
80 | |
---|
81 | inline bool ParticleEmitter::isEnabled() const |
---|
82 | { |
---|
83 | return _enabled; |
---|
84 | } |
---|
85 | |
---|
86 | #endif |
---|