File: ParticleProperties.h

package info (click to toggle)
freespace2 24.0.2%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: trixie
  • size: 43,188 kB
  • sloc: cpp: 583,107; ansic: 21,729; python: 1,174; sh: 464; makefile: 248; xml: 181
file content (60 lines) | stat: -rw-r--r-- 1,409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once

#include "particle/particle.h"
#include "utils/RandomRange.h"

namespace particle {
namespace util {
/**
 * @brief The creation properties of a particle
 *
 * This can be used by effects to store range values for particle creation
 *
 * @ingroup particleUtils
 */
class ParticleProperties {
private:
	/**
	 * @brief Choose particle from bitmap list
	 */
	int chooseBitmap();

 public:

	SCP_vector<int> m_bitmap_list;
	::util::UniformRange<size_t> m_bitmap_range;
	::util::UniformFloatRange m_radius;
	bool m_parentLifetime = false;
	bool m_parentScale = false;
	bool m_hasLifetime = false;
	::util::UniformFloatRange m_lifetime;
	::util::UniformFloatRange m_length;
	int m_size_lifetime_curve;
	int m_vel_lifetime_curve;

	ParticleProperties();

	/**
	 * @brief Parses the particle values
	 * @param nocreate @c true if +nocreate was found
	 */
	void parse(bool nocreate);

	/**
	 * @brief Creates a particle with the stored values
	 * @param info The base values of the particle. Some values will be overwritten by this function
	 * @return The created particle
	 */
	void createParticle(particle_info& info);

	/**
	 * @brief Creates a particle with the stored values
	 * @param info The base values of the particle. Some values will be overwritten by this function
	 * @return The created particle
	 */
	WeakParticlePtr createPersistentParticle(particle_info& info);

	void pageIn();
};
}
}