Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JPAEmitter.h
Go to the documentation of this file.
1#ifndef JPAEMITTER_H
2#define JPAEMITTER_H
3
11
13class JPABaseEmitter;
16
23 /* 0x04 */ JPAResource* mpRes;
25 /* 0x0C */ JPARandom mRndm;
29 /* 0x34 */ f32 mVolumeSize;
30 /* 0x38 */ f32 mVolumeMinRad;
31 /* 0x3C */ f32 mVolumeSweep;
32 /* 0x40 */ s32 mEmitCount;
33 /* 0x44 */ s32 mVolumeEmitIdx;
34 /* 0x48 */ Mtx mDirectionMtx;
35 /* 0x78 */ Mtx mRotationMtx;
36 /* 0xA8 */ Mtx mGlobalRot;
37 /* 0xD8 */ Mtx mGlobalSR;
45 /* 0x154 */ Mtx mYBBCamMtx;
46 /* 0x184 */ Mtx mPosCamMtx;
47 /* 0x1B4 */ Mtx mPrjMtx;
50 /* 0x1EC */ s32 mVolumeAngleNum;
51 /* 0x1F0 */ s32 mVolumeAngleMax;
52 /* 0x1F4 */ s32 mVolumeX;
53 /* 0x1F8 */ s32 mDivNumber;
54 /* 0x1FC */ f32 mScaleAnm;
55 /* 0x200 */ u32 mDirType;
56 /* 0x204 */ u32 mRotType;
57 /* 0x208 */ u32 mPlaneType;
58 /* 0x20C */ u32 mDLType;
59 /* 0x210 */ u32 mPrjType;
60 /* 0x214 */ s16 mClrKeyFrame;
61 /* 0x216 */ u8 mDrawCount;
62};
63
69public:
70 virtual ~JPAEmitterCallBack() = 0;
71 /* 80050368 */ virtual void execute(JPABaseEmitter*) {}
72 /* 80050374 */ virtual void executeAfter(JPABaseEmitter*) {}
73 /* 8005036C */ virtual void draw(JPABaseEmitter*) {}
74 /* 80050370 */ virtual void drawAfter(JPABaseEmitter*) {}
75
76 /* 8027E6A4 */ //~JPAEmitterCallBack();
77};
78
79enum {
88};
89
95public:
96 /* 8027E5EC */ ~JPABaseEmitter() {}
97 /* 8027E64C */ JPABaseEmitter() : mLink(this) {}
98 /* 8027E6EC */ void init(JPAEmitterManager*, JPAResource*);
99 /* 8027EDD4 */ bool processTillStartFrame();
100 /* 8027EE14 */ bool processTermination();
101 /* 8027EEB0 */ void calcEmitterGlobalPosition(JGeometry::TVec3<f32>*) const;
102 /* 8027EC60 */ void deleteAllParticle();
104 /* 8027EA40 */ JPABaseParticle* createParticle();
105 /* 8027EF30 */ u32 getCurrentCreateNumber() const;
106 /* 8027EF40 */ u8 getDrawCount() const;
107 /* 8027EF50 */ bool loadTexture(u8, GXTexMapID);
108
113 bool checkFlag(u32 flag) { return !!(mpRes->getDyn()->getFlag() & flag); }
115 u8 getGroupID() const { return mGroupID; }
116 u8 getDrawTimes() const { return mDrawTimes; }
117 void setRate(f32 rate) { mRate = rate; }
122 void setGlobalSRTMatrix(const Mtx m) {
124
125 // set is actually used here in debug
128 }
142 void setVolumeSize(u16 size) { mVolumeSize = size; }
148 void setLocalRotation(const JGeometry::TVec3<s16>& i_rot) { mLocalRot.set(i_rot.x * 0.005493248f, i_rot.y * 0.005493248f, i_rot.z * 0.005493248f); }
150
152 mGlobalPScl.y = height;
153 }
155 mGlobalPScl.set(scale.x, scale.y);
156 }
164 mGlobalScl.set(scale);
165 mGlobalPScl.set(scale.x ,scale.y);
166 }
171 void setDirection(const JGeometry::TVec3<f32>& direction) {
172 mLocalDir.set(direction);
173 }
174
176 mLocalScl.set(scale);
177 }
178
179 f32 get_r_f() { return mRndm.get_rndm_f(); }
183
191 mMaxFrame = 1;
192 }
193
199
212 u32 getAge() const { return mTick; }
213
214public:
218 /* 0x24 */ s32 mMaxFrame;
219 /* 0x28 */ f32 mRate;
220 /* 0x2C */ f32 mVolumeSweep;
221 /* 0x30 */ f32 mVolumeMinRad;
224 /* 0x3C */ f32 mDirSpeed;
225 /* 0x40 */ f32 mSpread;
226 /* 0x44 */ f32 mRndmDirSpeed;
227 /* 0x48 */ f32 mAirResist;
229 /* 0x52 */ s16 mLifeTime;
230 /* 0x54 */ u16 mVolumeSize;
231 /* 0x56 */ u8 mRateStep;
233 /* 0x68 */ Mtx mGlobalRot;
239 /* 0xC0 */ s32 mpUserWork;
240 /* 0xC4 */ JPARandom mRndm;
245 /* 0xE8 */ JPAResource* mpRes;
248 /* 0xF4 */ volatile u32 mStatus;
249 /* 0xF8 */ f32 mEmitCount;
250 /* 0xFC */ f32 mScaleOut;
251 /* 0x100 */ u32 mTick;
252 /* 0x104 */ s16 mWaitTime;
253 /* 0x106 */ s16 mRateStepTimer;
254 /* 0x108 */ GXColor mPrmClr;
255 /* 0x10C */ GXColor mEnvClr;
256 /* 0x110 */ u8 mDrawTimes;
257 /* 0x111 */ u8 mTexAnmIdx;
258 /* 0x112 */ u8 mGroupID;
259 /* 0x113 */ u8 mResMgrID;
260};
261
262enum {
264};
265
266#endif /* JPAEMITTER_H */
enum _GXTexMapID GXTexMapID
@ JPAEmtrStts_FirstEmit
Definition JPAEmitter.h:84
@ JPAEmtrStts_Immortal
Definition JPAEmitter.h:86
@ JPAEmtrStts_RateStepEmit
Definition JPAEmitter.h:85
@ JPAEmtrStts_StopDraw
Definition JPAEmitter.h:82
@ JPAEmtrStts_EnableDeleteEmitter
Definition JPAEmitter.h:83
@ JPAEmtrStts_StopEmit
Definition JPAEmitter.h:80
@ JPAEmtrStts_StopCalc
Definition JPAEmitter.h:81
@ JPAEmtrStts_Delete
Definition JPAEmitter.h:87
@ JPAPtclStts_Invisible
Definition JPAEmitter.h:263
void JPAGetXYZRotateMtx(s16 x, s16 y, s16 z, Mtx mtx)
Definition JPAMath.cpp:98
void JPASetRMtxTVecfromMtx(f32 const (*param_0)[4], f32(*param_1)[4], JGeometry::TVec3< f32 > *param_2)
Definition JPAMath.cpp:125
void JPASetRMtxSTVecfromMtx(f32 const (*param_0)[4], f32(*param_1)[4], JGeometry::TVec3< f32 > *param_2, JGeometry::TVec3< f32 > *param_3)
Definition JPAMath.cpp:133
T cLib_calcTimer(T *value)
Definition c_lib.h:79
Definition JPAEmitter.h:94
void setLocalRotation(const JGeometry::TVec3< s16 > &i_rot)
Definition JPAEmitter.h:148
JPAEmitterCallBack * mpEmtrCallBack
Definition JPAEmitter.h:246
f32 mSpread
Definition JPAEmitter.h:225
void setUserWork(u32 userWork)
Definition JPAEmitter.h:201
void setDirection(const JGeometry::TVec3< f32 > &direction)
Definition JPAEmitter.h:171
void setStatus(u32 status)
Definition JPAEmitter.h:110
u32 mTick
Definition JPAEmitter.h:251
u8 mGroupID
Definition JPAEmitter.h:258
JGeometry::TVec3< f32 > mGlobalTrs
Definition JPAEmitter.h:235
s32 mpUserWork
Definition JPAEmitter.h:239
JGeometry::TVec3< f32 > mLocalScl
Definition JPAEmitter.h:215
u8 getDrawTimes() const
Definition JPAEmitter.h:116
void setLocalTranslation(const JGeometry::TVec3< f32 > &i_trans)
Definition JPAEmitter.h:147
JPABaseParticle * createParticle()
Definition JPAEmitter.cpp:84
void deleteAllParticle()
Definition JPAEmitter.cpp:110
GXColor mPrmClr
Definition JPAEmitter.h:254
void clearStatus(u32 status)
Definition JPAEmitter.h:111
void setGlobalEnvColor(u8 r, u8 g, u8 b)
Definition JPAEmitter.h:141
f32 mAwayFromCenterSpeed
Definition JPAEmitter.h:222
u8 getResourceManagerID() const
Definition JPAEmitter.h:114
u32 checkStatus(u32 status)
Definition JPAEmitter.h:112
void stopCreateParticle()
Definition JPAEmitter.h:184
JPARandom mRndm
Definition JPAEmitter.h:240
void stopDrawParticle()
Definition JPAEmitter.h:197
u8 getGroupID() const
Definition JPAEmitter.h:115
void setGlobalScale(const JGeometry::TVec3< f32 > &scale)
Definition JPAEmitter.h:163
void setGlobalRotation(const JGeometry::TVec3< s16 > &rot)
Definition JPAEmitter.h:132
s16 get_r_ss()
Definition JPAEmitter.h:182
f32 mAirResist
Definition JPAEmitter.h:227
s32 mMaxFrame
Definition JPAEmitter.h:218
u8 mRateStep
Definition JPAEmitter.h:231
JPAParticleCallBack * getParticleCallBackPtr()
Definition JPAEmitter.h:210
void quitImmortalEmitter()
Definition JPAEmitter.h:194
~JPABaseEmitter()
Definition JPAEmitter.h:96
void setParticleCallBackPtr(JPAParticleCallBack *cb)
Definition JPAEmitter.h:209
bool processTillStartFrame()
Definition JPAEmitter.cpp:118
void playDrawParticle()
Definition JPAEmitter.h:198
JGeometry::TVec2< f32 > mGlobalPScl
Definition JPAEmitter.h:236
JPABaseParticle * createChild(JPABaseParticle *)
Definition JPAEmitter.cpp:98
void stopCalcEmitter()
Definition JPAEmitter.h:195
GXColor mGlobalEnvClr
Definition JPAEmitter.h:238
void setEmitterCallBackPtr(JPAEmitterCallBack *ptr)
Definition JPAEmitter.h:120
JPAList< JPABaseParticle > * mpPtclPool
Definition JPAEmitter.h:243
JGeometry::TVec3< f32 > mGlobalScl
Definition JPAEmitter.h:234
void setGlobalParticleScale(f32 scaleX, f32 scaleY)
Definition JPAEmitter.h:157
f32 mScaleOut
Definition JPAEmitter.h:250
void setAwayFromCenterSpeed(f32 i_speed)
Definition JPAEmitter.h:144
void setRandomDirectionSpeed(f32 i_speed)
Definition JPAEmitter.h:119
u8 mTexAnmIdx
Definition JPAEmitter.h:257
JSULink< JPABaseEmitter > mLink
Definition JPAEmitter.h:232
void getGlobalTranslation(JGeometry::TVec3< f32 > *out) const
Definition JPAEmitter.h:135
f32 get_r_zh()
Definition JPAEmitter.h:181
void setGlobalPrmColor(u8 r, u8 g, u8 b)
Definition JPAEmitter.h:140
JGeometry::TVec3< f32 > mLocalTrs
Definition JPAEmitter.h:216
f32 mVolumeSweep
Definition JPAEmitter.h:220
f32 mRndmDirSpeed
Definition JPAEmitter.h:226
void getGlobalPrmColor(GXColor &color)
Definition JPAEmitter.h:139
void becomeImmortalEmitter()
Definition JPAEmitter.h:186
JPAList< JPABaseParticle > mAlivePtclBase
Definition JPAEmitter.h:241
void playCalcEmitter()
Definition JPAEmitter.h:196
u8 getDrawCount() const
Definition JPAEmitter.cpp:174
u8 mDrawTimes
Definition JPAEmitter.h:256
void becomeContinuousParticle()
Definition JPAEmitter.h:187
f32 mRate
Definition JPAEmitter.h:219
JPAParticleCallBack * mpPtclCallBack
Definition JPAEmitter.h:247
f32 mDirSpeed
Definition JPAEmitter.h:224
JGeometry::TVec3< f32 > mLocalDir
Definition JPAEmitter.h:217
f32 mAwayFromAxisSpeed
Definition JPAEmitter.h:223
JPAResource * mpRes
Definition JPAEmitter.h:245
volatile u32 mStatus
Definition JPAEmitter.h:248
void setGlobalParticleHeightScale(f32 height)
Definition JPAEmitter.h:151
GXColor mGlobalPrmClr
Definition JPAEmitter.h:237
u8 getGlobalAlpha()
Definition JPAEmitter.h:138
JGeometry::TVec3< s16 > mLocalRot
Definition JPAEmitter.h:228
GXColor mEnvClr
Definition JPAEmitter.h:255
u32 getParticleNumber()
Definition JPAEmitter.h:202
JPAList< JPABaseParticle > mAlivePtclChld
Definition JPAEmitter.h:242
void getLocalTranslation(JGeometry::TVec3< f32 > &vec)
Definition JPAEmitter.h:131
void getGlobalParticleScale(JGeometry::TVec3< f32 > &scale)
Definition JPAEmitter.h:160
void setGlobalAlpha(u8 alpha)
Definition JPAEmitter.h:137
bool isEnableDeleteEmitter()
Definition JPAEmitter.h:205
JPAEmitterManager * mpEmtrMgr
Definition JPAEmitter.h:244
bool processTermination()
Definition JPAEmitter.cpp:132
void initStatus(u32 status)
Definition JPAEmitter.h:109
void setGlobalTranslation(const JGeometry::TVec3< f32 > &trs)
Definition JPAEmitter.h:130
u8 mResMgrID
Definition JPAEmitter.h:259
void setGlobalParticleScale(const JGeometry::TVec3< f32 > &scale)
Definition JPAEmitter.h:154
void calcEmitterGlobalPosition(JGeometry::TVec3< f32 > *) const
Definition JPAEmitter.cpp:156
void setDirectionalSpeed(f32 i_speed)
Definition JPAEmitter.h:118
void setVolumeSize(u16 size)
Definition JPAEmitter.h:142
void setGlobalRTMatrix(const Mtx m)
Definition JPAEmitter.h:121
u16 mVolumeSize
Definition JPAEmitter.h:230
void setRate(f32 rate)
Definition JPAEmitter.h:117
void setLifeTime(s16 lifetime)
Definition JPAEmitter.h:143
void becomeInvalidEmitter()
Definition JPAEmitter.h:189
u32 getUserWork()
Definition JPAEmitter.h:200
void setSpread(f32 i_spread)
Definition JPAEmitter.h:146
s16 mRateStepTimer
Definition JPAEmitter.h:253
void playCreateParticle()
Definition JPAEmitter.h:185
void setDrawTimes(u8 drawTimes)
Definition JPAEmitter.h:208
f32 mVolumeMinRad
Definition JPAEmitter.h:221
JPAEmitterCallBack * getEmitterCallBackPtr() const
Definition JPAEmitter.h:211
s16 mWaitTime
Definition JPAEmitter.h:252
void setGlobalSRTMatrix(const MtxP matrix)
Definition JPAEmitter.h:167
f32 get_r_f()
Definition JPAEmitter.h:179
void becomeDeleteEmitter()
Definition JPAEmitter.h:188
f32 mEmitCount
Definition JPAEmitter.h:249
void setRateStep(u8 i_step)
Definition JPAEmitter.h:149
Mtx mGlobalRot
Definition JPAEmitter.h:233
bool checkFlag(u32 flag)
Definition JPAEmitter.h:113
u32 getAge() const
Definition JPAEmitter.h:212
void setLocalScale(const JGeometry::TVec3< f32 > &scale)
Definition JPAEmitter.h:175
u32 getCurrentCreateNumber() const
Definition JPAEmitter.cpp:168
s16 mLifeTime
Definition JPAEmitter.h:229
f32 get_r_zp()
Definition JPAEmitter.h:180
void setGlobalDynamicsScale(const JGeometry::TVec3< f32 > &i_scale)
Definition JPAEmitter.h:136
void setAwayFromAxisSpeed(f32 i_speed)
Definition JPAEmitter.h:145
void setGlobalSRTMatrix(const Mtx m)
Definition JPAEmitter.h:122
void setGlobalTranslation(f32 x, f32 y, f32 z)
Definition JPAEmitter.h:129
JPABaseEmitter()
Definition JPAEmitter.h:97
bool loadTexture(u8, GXTexMapID)
Definition JPAEmitter.cpp:180
Definition JPAParticle.h:20
u32 getFlag() const
Definition JPADynamicsBlock.h:71
Definition JPAEmitter.h:68
virtual void drawAfter(JPABaseEmitter *)
Definition JPAEmitter.h:74
virtual void executeAfter(JPABaseEmitter *)
Definition JPAEmitter.h:72
virtual void execute(JPABaseEmitter *)
Definition JPAEmitter.h:71
virtual void draw(JPABaseEmitter *)
Definition JPAEmitter.h:73
virtual ~JPAEmitterCallBack()=0
Definition JPAEmitter.cpp:30
Definition JPAEmitterManager.h:22
Definition JPAParticle.h:79
Definition JPAResourceManager.h:14
Definition JPAResource.h:23
JPADynamicsBlock * getDyn() const
Definition JPAResource.h:44
static SECTION_DATA u8 color[4]
Definition d_a_obj_crope.cpp:225
static initFunc init[]
Definition d_menu_collect.cpp:42
static volatile BOOL flag
Definition dspproc.cpp:20
r
Definition e_acos.c:100
double x double x
Definition e_atan2.c:58
int m
Definition e_atan2.c:62
double x double y
Definition e_atan2.c:58
z
Definition e_pow.c:390
static s32 status
Definition fstload.c:6
static void cb(s32 result, DVDCommandBlock *block)
Definition fstload.c:15
f32(* MtxP)[4]
Definition mtx.h:18
f32 Mtx[3][4]
Definition mtx.h:15
Definition JGeometry.h:401
void set(T v)
Definition JGeometry.h:406
T x
Definition JGeometry.h:458
T y
Definition JGeometry.h:459
void set(const TVec3< f32 > &other)
Definition JGeometry.h:157
void set(s16 x_, s16 y_, s16 z_)
Definition JGeometry.h:106
Definition JGeometry.h:55
T x
Definition JGeometry.h:56
void set(const TVec3 &other)
Definition JGeometry.h:60
T y
Definition JGeometry.h:57
Definition JPAEmitter.h:21
JGeometry::TVec3< f32 > mVelAxis
Definition JPAEmitter.h:28
JGeometry::TVec2< f32 > mGlobalPtclScl
Definition JPAEmitter.h:43
JPAList< JPABaseParticle > * mpAlivePtcl
Definition JPAEmitter.h:48
JGeometry::TVec3< f32 > mVelOmni
Definition JPAEmitter.h:27
s32 mDivNumber
Definition JPAEmitter.h:53
s32 mVolumeEmitIdx
Definition JPAEmitter.h:33
Mtx mGlobalSR
Definition JPAEmitter.h:37
JGeometry::TVec3< f32 > mPublicScale
Definition JPAEmitter.h:41
u32 mPrjType
Definition JPAEmitter.h:59
u32 mRotType
Definition JPAEmitter.h:56
JPANode< JPABaseParticle > * mpCurNode
Definition JPAEmitter.h:49
Mtx mGlobalRot
Definition JPAEmitter.h:36
JGeometry::TVec3< f32 > mVolumePos
Definition JPAEmitter.h:26
f32 mVolumeMinRad
Definition JPAEmitter.h:30
JPABaseEmitter * mpEmtr
Definition JPAEmitter.h:22
JPARandom mRndm
Definition JPAEmitter.h:25
JGeometry::TVec3< f32 > mGlobalPos
Definition JPAEmitter.h:42
JGeometry::TVec3< f32 > mEmitterPos
Definition JPAEmitter.h:38
f32 mVolumeSize
Definition JPAEmitter.h:29
Mtx mPrjMtx
Definition JPAEmitter.h:47
Mtx mRotationMtx
Definition JPAEmitter.h:35
JGeometry::TVec2< f32 > mPivot
Definition JPAEmitter.h:44
f32 mScaleAnm
Definition JPAEmitter.h:54
s16 mClrKeyFrame
Definition JPAEmitter.h:60
f32 mVolumeSweep
Definition JPAEmitter.h:31
u32 mDLType
Definition JPAEmitter.h:58
u32 mDirType
Definition JPAEmitter.h:55
Mtx mDirectionMtx
Definition JPAEmitter.h:34
JPAResource * mpRes
Definition JPAEmitter.h:23
s32 mVolumeX
Definition JPAEmitter.h:52
Mtx mYBBCamMtx
Definition JPAEmitter.h:45
Mtx mPosCamMtx
Definition JPAEmitter.h:46
JPAResourceManager * mpResMgr
Definition JPAEmitter.h:24
JGeometry::TVec3< f32 > mGlobalScl
Definition JPAEmitter.h:39
s32 mVolumeAngleNum
Definition JPAEmitter.h:50
JGeometry::TVec3< f32 > mGlobalEmtrDir
Definition JPAEmitter.h:40
s32 mVolumeAngleMax
Definition JPAEmitter.h:51
u32 mPlaneType
Definition JPAEmitter.h:57
s32 mEmitCount
Definition JPAEmitter.h:32
u8 mDrawCount
Definition JPAEmitter.h:61
Definition JPAList.h:31
u32 getNum() const
Definition JPAList.h:41
Definition JPAList.h:11
Definition JPARandom.h:10
s16 get_rndm_ss()
Definition JPARandom.h:35
f32 get_rndm_f()
Definition JPARandom.h:17
f32 get_rndm_zh()
Definition JPARandom.h:31
f32 get_rndm_zp()
Definition JPARandom.h:26
f32 x
Definition vec.h:11
f32 y
Definition vec.h:11
Definition d_a_ep.cpp:68
u8 g
Definition GXStruct.h:10
u8 b
Definition GXStruct.h:11
u8 a
Definition GXStruct.h:12
u8 r
Definition GXStruct.h:9
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8