wavelength 1.0.0
Loading...
Searching...
No Matches
setparticlesaction.h
Go to the documentation of this file.
1#pragma once
2
4#include "math/vector2.h"
5#include "math/vector3.h"
6#include "rnd/rndmat.h"
8#include "script/dataarray.h"
9
19public:
26 ~SetParticlesAction() override = default;
27
35 explicit SetParticlesAction(DataArray *pAction);
36
43 void Exec() override;
44
54 bool Poll() override;
55
56private:
57 // The values the node set.
58 enum Flag {
59 kFlagMaxParticles = 0x1,
60 kFlagLife = 0x2,
61 kFlagSpeed = 0x4,
62 kFlagSize = 0x8,
63 kFlagMat = 0x10,
64 kFlagEmitRate = 0x20,
65 kFlagPos = 0x40,
66 };
67
68 // The corners of the emission box.
69 enum Corner {
70 kCornerLow = 0,
71 kCornerHigh = 1,
72 kNumCorners = 2,
73 };
74
75 int mFlags;
76 RndParticleSys *mParticleSys;
77 int mMaxParticles;
78 float mDuration;
79 float mStartTime;
80 Vector2 mLife;
81 Vector2 mStartLife;
82 Vector2 mSpeed;
83 Vector2 mStartSpeed;
84 Vector2 mSize;
85 Vector2 mStartSize;
86 Vector2 mEmitRate;
87 Vector2 mStartEmitRate;
88 alignas(16) Vector3 mPos[kNumCorners];
89 alignas(16) Vector3 mStartPos[kNumCorners];
90 RndMat *mMat;
91};
Reference-counted array of script data nodes.
Definition dataarray.h:20
void Exec() override
Record the current ranges, apply the pool size and the material, and start the move.
~SetParticlesAction() override=default
Destroy the object.
bool Poll() override
Move the ranges for the time on the clock.
SetParticlesAction(DataArray *pAction)
Read the action.
Something a trigger does when its conditions hold.
Definition triggeraction.h:15