18#ifndef INCLUDED_PARTICLEEMITTER
19#define INCLUDED_PARTICLEEMITTER
200 std::unique_ptr<CModelAbstract>
Clone()
const override;
std::shared_ptr< CParticleEmitterType > CParticleEmitterTypePtr
Definition: ParticleEmitterType.h:123
std::shared_ptr< CParticleEmitter > CParticleEmitterPtr
Definition: ParticleEmitter.h:46
Definition: BoundingBoxAligned.h:34
Definition: Matrix3D.h:34
Abstract base class for graphical objects that are used by units, or as props attached to other CMode...
Definition: ModelAbstract.h:50
Particle emitter model, for attaching emitters as props on other models.
Definition: ParticleEmitter.h:189
void SetTransform(const CMatrix3D &transform) override
Definition: ParticleEmitter.cpp:312
std::unique_ptr< CModelAbstract > Clone() const override
Definition: ParticleEmitter.cpp:285
CModelParticleEmitter * ToCModelParticleEmitter() override
Dynamic cast.
Definition: ParticleEmitter.h:195
CModelParticleEmitter(const CParticleEmitterTypePtr &type)
Definition: ParticleEmitter.cpp:269
void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1) override
Called when terrain has changed in the given inclusive bounds.
Definition: ParticleEmitter.h:202
~CModelParticleEmitter() override
Definition: ParticleEmitter.cpp:275
CParticleEmitterTypePtr m_Type
Definition: ParticleEmitter.h:213
CParticleEmitterPtr m_Emitter
Definition: ParticleEmitter.h:214
void CalcBounds() override
(Re)calculates and stores any bounds or bound-dependent data for this object.
Definition: ParticleEmitter.cpp:290
void ValidatePosition() override
Ensure that both the transformation and the bone matrices are correct for this model and all its prop...
Definition: ParticleEmitter.cpp:299
void SetEntityVariable(const std::string &name, float value) override
Called when the entity tries to set some variable to affect the display of this model and/or its chil...
Definition: ParticleEmitter.cpp:280
void InvalidatePosition() override
Mark this model's position and bone matrices, and all props' positions as invalid.
Definition: ParticleEmitter.cpp:308
Particle emitter.
Definition: ParticleEmitter.h:69
CVector3D m_Pos
Definition: ParticleEmitter.h:157
float m_EmissionRoundingError
Definition: ParticleEmitter.h:166
std::vector< SParticle > m_Particles
Definition: ParticleEmitter.h:162
Renderer::Backend::IVertexInputLayout * m_VertexInputLayout
Definition: ParticleEmitter.h:180
CVector3D GetPosition() const
Definition: ParticleEmitter.h:81
int m_LastFrameNumber
Definition: ParticleEmitter.h:182
VertexArray::Attribute m_AttributeColor
Definition: ParticleEmitter.h:178
void SetPosition(const CVector3D &pos)
Set the position to be used for emission of new particles.
Definition: ParticleEmitter.h:76
void AddParticle(const SParticle &particle)
Push a new particle onto the ring buffer.
Definition: ParticleEmitter.cpp:254
void Bind(Renderer::Backend::IDeviceCommandContext *deviceCommandContext, Renderer::Backend::IShaderProgram *shader)
Bind rendering state (textures and blend modes).
Definition: ParticleEmitter.cpp:201
void UpdateArrayData(int frameNumber)
Update particle and vertex array data.
Definition: ParticleEmitter.cpp:100
const CBoundingBoxAligned & GetParticleBounds() const
Get the bounding box of the center points of particles at their current positions.
Definition: ParticleEmitter.h:102
void RenderArray(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Draw the vertex array.
Definition: ParticleEmitter.cpp:227
VertexArray::Attribute m_AttributeAxis
Definition: ParticleEmitter.h:176
const CQuaternion & GetRotation() const
Definition: ParticleEmitter.h:94
VertexArray::Attribute m_AttributeUV
Definition: ParticleEmitter.h:177
float m_LastUpdateTime
Definition: ParticleEmitter.h:165
CParticleEmitterTypePtr m_Type
Definition: ParticleEmitter.h:152
std::map< std::string, float > m_EntityVariables
Definition: ParticleEmitter.h:160
size_t m_NextParticleIdx
Definition: ParticleEmitter.h:163
void PrepareForRendering()
Make the vertex data available for subsequent binding and rendering.
Definition: ParticleEmitter.cpp:190
void SetRotation(const CQuaternion &rot)
Set the rotation to be used for emission of new particles (note: depends on particles).
Definition: ParticleEmitter.h:89
void SetEntityVariable(const std::string &name, float value)
Definition: ParticleEmitter.cpp:264
void Unattach(const CParticleEmitterPtr &self)
Stop this emitter emitting new particles, and pass responsibility for rendering to the CParticleManag...
Definition: ParticleEmitter.cpp:248
VertexIndexArray m_IndexArray
Definition: ParticleEmitter.h:172
bool m_Active
Whether this emitter is still emitting new particles.
Definition: ParticleEmitter.h:155
CBoundingBoxAligned m_ParticleBounds
Bounding box of the current particle center points.
Definition: ParticleEmitter.h:170
VertexArray m_VertexArray
Definition: ParticleEmitter.h:174
void UploadData(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Upload the vertex data to the backend.
Definition: ParticleEmitter.cpp:195
CQuaternion m_Rot
Definition: ParticleEmitter.h:158
CParticleEmitter(const CParticleEmitterTypePtr &type)
Definition: ParticleEmitter.cpp:32
VertexArray::Attribute m_AttributePos
Definition: ParticleEmitter.h:175
Definition: Quaternion.h:26
Definition: Vector3D.h:31
Definition: IDeviceCommandContext.h:42
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:81
Definition: VertexArray.h:138
A VertexArray that is specialised to handle 16-bit array indices.
Definition: VertexArray.h:220
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning.
Definition: code_annotation.h:40
Simulation state for a single particle.
Definition: ParticleEmitter.h:34
float size
Definition: ParticleEmitter.h:39
float angleSpeed
Definition: ParticleEmitter.h:38
float maxAge
Definition: ParticleEmitter.h:43
SColor4ub color
Definition: ParticleEmitter.h:41
CVector3D pos
Definition: ParticleEmitter.h:35
float angle
Definition: ParticleEmitter.h:37
float age
Definition: ParticleEmitter.h:42
float sizeGrowthRate
Definition: ParticleEmitter.h:40
CVector3D velocity
Definition: ParticleEmitter.h:36
Definition: VertexArray.h:141
intptr_t ssize_t
Definition: wposix_types.h:82