ScummVM API documentation
ParticleEmitter3D.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * Copyright (C) 2006-2010 - Frictional Games
24 *
25 * This file is part of HPL1 Engine.
26 */
27
28#ifndef HPL_PARTICLE_EMITTER_3D_H
29#define HPL_PARTICLE_EMITTER_3D_H
30
31#include "hpl1/engine/graphics/ParticleEmitter.h"
32#include "hpl1/engine/graphics/Renderable.h"
33#include "hpl1/engine/scene/Entity3D.h"
34
35namespace hpl {
36
37class cResourceImage;
38class cGraphics;
39class cWorld3D;
40class cParticleSystem3D;
41
42//---------------------------------------------
43
44// NEW
45enum ePEType {
46 ePEType_Normal,
47 ePEType_Beam,
48 ePEType_LastEnum,
49};
50
51// ---
52
53enum eParticleEmitter3DType {
54 eParticleEmitter3DType_FixedPoint,
55 eParticleEmitter3DType_DynamicPoint,
56 eParticleEmitter3DType_Line,
57 eParticleEmitter3DType_Axis,
58 eParticleEmitter3DType_LastEnum,
59};
60
61enum eParticleEmitter3DCoordSystem {
62 eParticleEmitter3DCoordSystem_World,
63 eParticleEmitter3DCoordSystem_Local,
64 eParticleEmitter3DCoordSystem_LastEnum,
65};
66
67//------------------------------------------
68
69kSaveData_ChildClass(iRenderable, iParticleEmitter3D) {
70 kSaveData_ClassInit(iParticleEmitter3D) public : tString msDataName;
71 cVector3f mvDataSize;
72
73 int mlTime;
74 bool mbDying;
75 float mfFrame;
76
77 virtual iSaveObject *CreateSaveObject(cSaveObjectHandler * apSaveObjectHandler, cGame * apGame);
78 virtual int GetSaveCreatePrio();
79};
80
81//------------------------------------------
82
84public:
85 cVector3f mvUV[4];
86};
87
88//------------------------------------------
89
93
95public:
96 iParticleEmitter3D(tString asName, tMaterialVec *avMaterials, unsigned int alMaxParticles,
97 cVector3f avSize, cGraphics *apGraphics, cResources *apResources);
98 virtual ~iParticleEmitter3D();
99
100 void UpdateLogic(float afTimeStep);
101
102 void Render() {}
103
104 eParticleEmitterType GetType() { return eParticleEmitterType_3D; }
105
106 void SetSubDivUV(const cVector2l &avSubDiv);
107
108 void SetWorld(cWorld3D *apWorld) { mpWorld = apWorld; }
109
110 void SetSystem(cParticleSystem3D *apSystem) { mpParentSystem = apSystem; }
111
112 // Entity implementation
113 tString GetEntityType() { return "ParticleEmitter3D"; }
114 bool IsVisible();
115 void SetVisible(bool abVisible) { SetRendered(abVisible); }
116
117 // Renderable implementation
118 void UpdateGraphics(cCamera3D *apCamera, float afFrameTime, cRenderList *apRenderList);
119
120 iMaterial *GetMaterial();
121 iVertexBuffer *GetVertexBuffer();
122
123 bool IsShadowCaster() { return false; }
124
125 cBoundingVolume *GetBoundingVolume();
126
127 cMatrixf *GetModelMatrix(cCamera3D *apCamera);
128
129 int GetMatrixUpdateCount() { return GetTransformUpdateCount(); }
130 eRenderableType GetRenderType() { return eRenderableType_Normal; }
131
132 // SaveObject implementation
134 virtual void SaveToSaveData(iSaveData *apSaveData);
135 virtual void LoadFromSaveData(iSaveData *apSaveData);
136 virtual void SaveDataSetup(cSaveObjectHandler *apSaveObjectHandler, cGame *apGame);
137
138protected:
139 int mlUpdateCount;
140 float mfTimeStepAccum;
141
142 iVertexBuffer *mpVtxBuffer;
143
145
146 cVector3f mvDirection;
147 int mlDirectionUpdateCount;
148
149 cVector3f mvRight;
150 cVector3f mvForward;
151 int mlAxisDrawUpdateCount;
152
153 cParticleSystem3D *mpParentSystem;
154
155 // Set by the particle system implementation.
156 cVector2f mvDrawSize;
157 cVector2f mvMaxDrawSize;
158
159 eParticleEmitter3DType mDrawType;
160
161 eParticleEmitter3DCoordSystem mCoordSystem;
162
163 cWorld3D *mpWorld;
164
165 bool mbUsesDirection;
166
167 // NEW
168 bool mbUsePartSpin;
169 bool mbUseRevolution;
170
171 ePEType mPEType;
172
173 // ---
174};
175} // namespace hpl
176
177#endif // HPL_PARTICLE_EMITTER_3D_H
Definition: str.h:59
Definition: BoundingVolume.h:71
Definition: Camera3D.h:53
Definition: Game.h:91
Definition: Graphics.h:46
Definition: ParticleEmitter3D.h:83
Definition: ParticleSystem3D.h:90
Definition: RenderList.h:145
Definition: Resources.h:160
Definition: SaveGame.h:183
Definition: World3D.h:179
Definition: Material.h:203
Definition: ParticleEmitter3D.h:94
virtual void LoadFromSaveData(iSaveData *apSaveData)
virtual void SaveDataSetup(cSaveObjectHandler *apSaveObjectHandler, cGame *apGame)
virtual iSaveData * CreateSaveData()
virtual void SaveToSaveData(iSaveData *apSaveData)
int GetMatrixUpdateCount()
Definition: ParticleEmitter3D.h:129
Definition: ParticleEmitter.h:133
Definition: Renderable.h:70
Definition: SaveGame.h:111
Definition: VertexBuffer.h:90