TDME2 1.9.121
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PointParticleEmitter.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <tdme/tdme.h>
10#include <tdme/math/fwd-tdme.h>
11#include <tdme/math/Vector3.h>
12
18
19/**
20 * Point particle emitter
21 * @author Andreas Drewke
22 * @version $Id$
23 */
25 : public ParticleEmitter
26{
27private:
28 int32_t count;
29 int64_t lifeTime;
30 int64_t lifeTimeRnd;
31 float mass;
32 float massRnd;
40
41public:
42 /**
43 * Public constructor
44 * @param count number of particles to emit in one second
45 * @param lifeTime life time in milli seconds
46 * @param lifeTimeRnd life time rnd in milli seconds
47 * @param mass mass in kg
48 * @param massRnd mass rnd in kg
49 * @param position position to emit from
50 * @param velocity velocity in meter / seconds
51 * @param velocityRnd velocity rnd in meter / seconds
52 * @param colorStart start color
53 * @param colorEnd end color
54 */
55 PointParticleEmitter(int32_t count, int64_t lifeTime, int64_t lifeTimeRnd, float mass, float massRnd, const Vector3& position, const Vector3& velocity, const Vector3& velocityRnd, const Color4& colorStart, const Color4& colorEnd);
56
57 // overridden methods
58 inline const Vector3& getCenter() const override {
60 }
61
62 inline int32_t getCount() const override {
63 return count;
64 }
65
66 inline const Vector3& getVelocity() const {
67 return velocity;
68 }
69
70 inline const Vector3& getVelocityRnd() const {
71 return velocityRnd;
72 }
73
74 inline const Color4& getColorStart() const override {
75 return colorStart;
76 }
77
78 inline void setColorStart(const Color4& colorStart) override {
79 this->colorStart = colorStart;
80 }
81
82 inline const Color4& getColorEnd() const override {
83 return colorEnd;
84 }
85
86 inline void setColorEnd(const Color4& colorEnd) override {
87 this->colorEnd = colorEnd;
88 }
89
90 void emit(Particle* particle) override;
91 void fromTransformations(const Transformations& transformations) override;
92
93};
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.
void fromTransformations(const Transformations &transformations) override
Update transformation with given transformations.
PointParticleEmitter(int32_t count, int64_t lifeTime, int64_t lifeTimeRnd, float mass, float massRnd, const Vector3 &position, const Vector3 &velocity, const Vector3 &velocityRnd, const Color4 &colorStart, const Color4 &colorEnd)
Public constructor.
void emit(Particle *particle) override
Emits particles.
3D vector 3 class
Definition: Vector3.h:22