TDME2 1.9.121
CircleParticleEmitter.h
Go to the documentation of this file.
1#pragma once
2
3#include <tdme/tdme.h>
10#include <tdme/math/Vector3.h>
11
17
18/**
19 * Circle particle emitter
20 * @author Andreas Drewke
21 * @version $Id$
22 */
24 : public ParticleEmitter
25{
26private:
27 int32_t count;
28 int64_t lifeTime;
29 int64_t lifeTimeRnd;
33 float radius;
38 float mass;
39 float massRnd;
44public:
45 /**
46 * Public constructor
47 * @param count particles to emit in one second
48 * @param lifeTime life time
49 * @param lifeTimeRnd life time rnd
50 * @param axis0 axis 0
51 * @param axis1 axis 1
52 * @param center center
53 * @param radius radius
54 * @param mass mass
55 * @param massRnd mass rnd
56 * @param velocity velocity
57 * @param velocityRnd velocity rnd
58 * @param colorStart color start
59 * @param colorEnd color end
60 */
61 CircleParticleEmitter(int32_t count, int64_t lifeTime, int64_t lifeTimeRnd, const Vector3& axis0, const Vector3& axis1, const Vector3& center, float radius, float mass, float massRnd, const Vector3& velocity, const Vector3& velocityRnd, const Color4& colorStart, const Color4& colorEnd);
62
63 // overridden methods
64 inline const Vector3& getCenter() const override {
65 return centerTransformed;
66 }
67
68 inline int32_t getCount() const override {
69 return count;
70 }
71
72 inline const Vector3& getVelocity() const {
73 return velocity;
74 }
75
76 inline const Vector3& getVelocityRnd() const {
77 return velocityRnd;
78 }
79
80 inline const Color4& getColorStart() const override {
81 return colorStart;
82 }
83
84 inline void setColorStart(const Color4& colorStart) override {
85 this->colorStart = colorStart;
86 }
87
88 inline const Color4& getColorEnd() const override {
89 return colorEnd;
90 }
91
92 inline void setColorEnd(const Color4& colorEnd) override {
93 this->colorEnd = colorEnd;
94 }
95
96 void emit(Particle* particle) override;
97 void fromTransformations(const Transformations& transformations) override;
98
99};
Transformations which contain scale, rotations and translation.
Color 4 definition.
Definition: Color4.h:20
void setColorEnd(const Color4 &colorEnd) override
Set end color.
void setColorStart(const Color4 &colorStart) override
Set start color.
CircleParticleEmitter(int32_t count, int64_t lifeTime, int64_t lifeTimeRnd, const Vector3 &axis0, const Vector3 &axis1, const Vector3 &center, float radius, float mass, float massRnd, const Vector3 &velocity, const Vector3 &velocityRnd, const Color4 &colorStart, const Color4 &colorEnd)
Public constructor.
void fromTransformations(const Transformations &transformations) override
Update transformation with given transformations.
void emit(Particle *particle) override
Emits particles.
3D vector 3 class
Definition: Vector3.h:22