|
Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
|
#include <Emitter.hpp>
Public Member Functions | |
| Emitter () | |
| ~Emitter () | |
| virtual void | Compile () |
| Compiles the emitter and associated particle. After this, the particle can't be changed. Any particle enum values are also no longer changeable. NOTE: This needs to be called before the emitter can be used. More... | |
| virtual void | Update (float deltaTime) |
| Update the emitter. More... | |
| void | SetParticle (eastl::shared_ptr< Particle > particle) |
| Sets the particle of the emitter. More... | |
| eastl::weak_ptr< Particle > | GetParticle () const |
| Returns a copy of the particle of the emitter. More... | |
| void | SetMaxParticleCount (uint32_t count) |
| Sets the maximum number of particles this emitter can have alive at the same time. More... | |
| uint32_t | GetMaxParticleCount () const |
| Returns the maximum number of particles this emitter can have alive at the same time. More... | |
| void | SetMaxParticleCountReachedAction (MaxParticleReachedAction action) |
| Sets the action that should be used when trying to spawn a new particle while already having the maximum number of particles alive. More... | |
| MaxParticleReachedAction | GetMaxParticleCountReachedAction () const |
| Returns the action that should be used when trying to spawn a new particle while already having the maximum number of particles alive. More... | |
| void | SetEmitterType (EmitterType type) |
| Sets the type of the emitter. More... | |
| EmitterType | GetEmitterType () const |
| Returns the type of the emitter. More... | |
| void | SetEmitterShape (EmitterShape shape) |
| Sets the shape of the area the emitter will emit particles in (outline means particles will only be generated along the edges of the shape). More... | |
| EmitterShape | GetEmitterShape () const |
| Returns the shape of emitter. More... | |
| void | SetParticleGenerationStyle (ParticleGenerationStyle style) |
| Sets how the particles are generated. Constant indicates that a new particle is generated every x amount of time, while random indicates that an average of x particles is generated every second. More... | |
| ParticleGenerationStyle | GetParticleGenerationStyle () const |
| Returns the style in which particles are generated. More... | |
| void | SetBurstDuration (float durationMin, float durationMax) |
| Sets the minimum and maximum duration a burst can have. When activated, a random duration will be picked somewhere in between these values. More... | |
| eastl::pair< float, float > | GetBurstDuration () |
| Returns the minimum and maximum duration of a burst. More... | |
| void | SetBurstParticleCount (float particlesMin, float particlesMax) |
| sets the minimum and maximum amount of particles spawned when the burst is triggered. When activated, a random number will be picked somewhere in between these values. More... | |
| eastl::pair< float, float > | GetBurstParticleCount () |
| Returns the minimum and maximum amount of particles spawned when the burst is triggered. More... | |
| void | SetParticlesPerSecond (float particles) |
| Sets the amount of particles generated by a continuous emitter. More... | |
| float | GetParticlesPerSecond () const |
| Returns the amount of particles generated by a continuous emitter. More... | |
| void | SetEmitterSphereRadius (float radius) |
| Sets the radius of the emitter sphere. More... | |
| float | GetEmitterSphereRadius () const |
| Returns the radius of the emitter sphere. More... | |
| void | SetEmitterSphereCenter (glm::vec3 center) |
| Sets the center of the emitter sphere. More... | |
| glm::vec3 | GetEmitterSphereCenter () const |
| Returns the center of the emitter sphere. More... | |
| void | SetEmitterBox (glm::vec3 corner1, glm::vec3 corner2) |
| Sets the corners of the box emitter. More... | |
| eastl::pair< glm::vec3, glm::vec3 > | GetEmitterBox () |
| Returns the corners of the emitter box. More... | |
| void | SetEmitterLine (glm::vec3 start, glm::vec3 end) |
| Sets the start and end of the emitter line. More... | |
| eastl::pair< glm::vec3, glm::vec3 > | GetEmitterLine () |
| Returns the start and end of the emitter line. More... | |
| void | SetEmitterPointLocation (glm::vec3 point) |
| Sets the location of a point emitter. More... | |
| glm::vec3 | GetEmitterPointLocation () const |
| Returns the location of a point emitter. More... | |
Protected Attributes | |
| eastl::shared_ptr< Particle > | particle |
| uint32_t | maxParticleCount |
| MaxParticleReachedAction | maxParticleReachedAction |
| EmitterType | emitterType |
| EmitterShape | emitterShape |
| ParticleGenerationStyle | particleGenerationStyle |
| bool | active |
| bool | compiled |
| float | particlesPerSecond |
| float | burstParticleCountMin |
| float | burstParticleCountMax |
| float | burstParticles |
| float | burstParticlesPerSecond |
| float | burstDurationMin |
| float | burstDurationMax |
| float | burstDuration |
| float | burstActiveTime |
| float | sphereRadius |
| glm::vec3 | sphereCenter |
| glm::vec3 | boxCorner1 |
| glm::vec3 | boxCorner2 |
| glm::vec3 | lineStart |
| glm::vec3 | lineEnd |
| glm::vec3 | pointLocation |
Definition at line 7 of file Emitter.hpp.
|
strong |
| Enumerator | |
|---|---|
| SPHERE | |
| SPHERE_OUTLINE | |
| BOX | |
| BOX_OUTLINE | |
| LINE | |
| POINT | |
Definition at line 30 of file Emitter.hpp.
|
strong |
| Enumerator | |
|---|---|
| CONTINUOUS | |
| BURST | |
Definition at line 25 of file Emitter.hpp.
|
strong |
| Enumerator | |
|---|---|
| DELETE_OLDEST | |
| DELETE_NEWEST | |
| DO_NOT_SPAWN | |
Definition at line 13 of file Emitter.hpp.
|
strong |
| Enumerator | |
|---|---|
| CONSTANT | |
| RANDOM | |
Definition at line 39 of file Emitter.hpp.
| Engine::Emitter::Emitter | ( | ) |
Definition at line 5 of file Emitter.cpp.
| Engine::Emitter::~Emitter | ( | ) |
Definition at line 12 of file Emitter.cpp.
|
virtual |
Compiles the emitter and associated particle. After this, the particle can't be changed. Any particle enum values are also no longer changeable. NOTE: This needs to be called before the emitter can be used.
Definition at line 16 of file Emitter.cpp.
| eastl::pair< float, float > Engine::Emitter::GetBurstDuration | ( | ) |
Returns the minimum and maximum duration of a burst.
Definition at line 95 of file Emitter.cpp.
| eastl::pair< float, float > Engine::Emitter::GetBurstParticleCount | ( | ) |
Returns the minimum and maximum amount of particles spawned when the burst is triggered.
Definition at line 106 of file Emitter.cpp.
| eastl::pair< glm::vec3, glm::vec3 > Engine::Emitter::GetEmitterBox | ( | ) |
Returns the corners of the emitter box.
Definition at line 155 of file Emitter.cpp.
| eastl::pair< glm::vec3, glm::vec3 > Engine::Emitter::GetEmitterLine | ( | ) |
Returns the start and end of the emitter line.
Definition at line 166 of file Emitter.cpp.
| glm::vec3 Engine::Emitter::GetEmitterPointLocation | ( | ) | const |
Returns the location of a point emitter.
Definition at line 176 of file Emitter.cpp.
| Emitter::EmitterShape Engine::Emitter::GetEmitterShape | ( | ) | const |
| glm::vec3 Engine::Emitter::GetEmitterSphereCenter | ( | ) | const |
Returns the center of the emitter sphere.
Definition at line 136 of file Emitter.cpp.
| float Engine::Emitter::GetEmitterSphereRadius | ( | ) | const |
Returns the radius of the emitter sphere.
Definition at line 126 of file Emitter.cpp.
| Emitter::EmitterType Engine::Emitter::GetEmitterType | ( | ) | const |
Returns the type of the emitter.
Definition at line 64 of file Emitter.cpp.
| uint32_t Engine::Emitter::GetMaxParticleCount | ( | ) | const |
Returns the maximum number of particles this emitter can have alive at the same time.
Definition at line 44 of file Emitter.cpp.
| Emitter::MaxParticleReachedAction Engine::Emitter::GetMaxParticleCountReachedAction | ( | ) | const |
Returns the action that should be used when trying to spawn a new particle while already having the maximum number of particles alive.
Definition at line 54 of file Emitter.cpp.
| eastl::weak_ptr< Particle > Engine::Emitter::GetParticle | ( | ) | const |
Returns a copy of the particle of the emitter.
Definition at line 33 of file Emitter.cpp.
| Emitter::ParticleGenerationStyle Engine::Emitter::GetParticleGenerationStyle | ( | ) | const |
Returns the style in which particles are generated.
Definition at line 84 of file Emitter.cpp.
| float Engine::Emitter::GetParticlesPerSecond | ( | ) | const |
Returns the amount of particles generated by a continuous emitter.
Definition at line 116 of file Emitter.cpp.
| void Engine::Emitter::SetBurstDuration | ( | float | durationMin, |
| float | durationMax | ||
| ) |
Sets the minimum and maximum duration a burst can have. When activated, a random duration will be picked somewhere in between these values.
| durationMin | The minimum duration in seconds. |
| durationMax | The minimum duration in seconds. |
Definition at line 89 of file Emitter.cpp.
| void Engine::Emitter::SetBurstParticleCount | ( | float | particlesMin, |
| float | particlesMax | ||
| ) |
sets the minimum and maximum amount of particles spawned when the burst is triggered. When activated, a random number will be picked somewhere in between these values.
| particlesMin | |
| particlesMax |
Definition at line 100 of file Emitter.cpp.
| void Engine::Emitter::SetEmitterBox | ( | glm::vec3 | corner1, |
| glm::vec3 | corner2 | ||
| ) |
Sets the corners of the box emitter.
| corner1 | A vec3 containing the first corner. |
| corner2 | A vec3 containing the second corner. |
Definition at line 141 of file Emitter.cpp.
| void Engine::Emitter::SetEmitterLine | ( | glm::vec3 | start, |
| glm::vec3 | end | ||
| ) |
Sets the start and end of the emitter line.
| start | The start position. |
| end | The end position. |
Definition at line 160 of file Emitter.cpp.
| void Engine::Emitter::SetEmitterPointLocation | ( | glm::vec3 | point | ) |
Sets the location of a point emitter.
| point | The postion of the emitter. |
Definition at line 171 of file Emitter.cpp.
| void Engine::Emitter::SetEmitterShape | ( | EmitterShape | shape | ) |
Sets the shape of the area the emitter will emit particles in (outline means particles will only be generated along the edges of the shape).
| shape | The new shape. |
Definition at line 69 of file Emitter.cpp.
| void Engine::Emitter::SetEmitterSphereCenter | ( | glm::vec3 | center | ) |
Sets the center of the emitter sphere.
| center | A vec3 containing the center. |
Definition at line 131 of file Emitter.cpp.
| void Engine::Emitter::SetEmitterSphereRadius | ( | float | radius | ) |
Sets the radius of the emitter sphere.
| radius | The radius. |
Definition at line 121 of file Emitter.cpp.
| void Engine::Emitter::SetEmitterType | ( | EmitterType | type | ) |
Sets the type of the emitter.
| type | The new type. |
Definition at line 59 of file Emitter.cpp.
| void Engine::Emitter::SetMaxParticleCount | ( | uint32_t | count | ) |
Sets the maximum number of particles this emitter can have alive at the same time.
| count | The maximum number of particles. |
Definition at line 38 of file Emitter.cpp.
| void Engine::Emitter::SetMaxParticleCountReachedAction | ( | MaxParticleReachedAction | action | ) |
Sets the action that should be used when trying to spawn a new particle while already having the maximum number of particles alive.
| action | The action to perform. |
Definition at line 49 of file Emitter.cpp.
| void Engine::Emitter::SetParticle | ( | eastl::shared_ptr< Particle > | particle | ) |
Sets the particle of the emitter.
| particle | The particle to set the emitter to. |
Definition at line 27 of file Emitter.cpp.
| void Engine::Emitter::SetParticleGenerationStyle | ( | ParticleGenerationStyle | style | ) |
Sets how the particles are generated. Constant indicates that a new particle is generated every x amount of time, while random indicates that an average of x particles is generated every second.
| style | The style of how the particles are generated. |
Definition at line 79 of file Emitter.cpp.
| void Engine::Emitter::SetParticlesPerSecond | ( | float | particles | ) |
Sets the amount of particles generated by a continuous emitter.
| particles | The number of particles per second. |
Definition at line 111 of file Emitter.cpp.
|
virtual |
Update the emitter.
| deltaTime | The time since the last call in seconds. |
Definition at line 21 of file Emitter.cpp.
|
protected |
Definition at line 247 of file Emitter.hpp.
|
protected |
Definition at line 269 of file Emitter.hpp.
|
protected |
Definition at line 269 of file Emitter.hpp.
|
protected |
Definition at line 263 of file Emitter.hpp.
|
protected |
Definition at line 261 of file Emitter.hpp.
|
protected |
Definition at line 259 of file Emitter.hpp.
|
protected |
Definition at line 259 of file Emitter.hpp.
|
protected |
Definition at line 253 of file Emitter.hpp.
|
protected |
Definition at line 253 of file Emitter.hpp.
|
protected |
Definition at line 255 of file Emitter.hpp.
|
protected |
Definition at line 257 of file Emitter.hpp.
|
protected |
Definition at line 249 of file Emitter.hpp.
|
protected |
Definition at line 243 of file Emitter.hpp.
|
protected |
Definition at line 241 of file Emitter.hpp.
|
protected |
Definition at line 271 of file Emitter.hpp.
|
protected |
Definition at line 271 of file Emitter.hpp.
|
protected |
Definition at line 237 of file Emitter.hpp.
|
protected |
Definition at line 239 of file Emitter.hpp.
|
protected |
Definition at line 235 of file Emitter.hpp.
|
protected |
Definition at line 245 of file Emitter.hpp.
|
protected |
Definition at line 251 of file Emitter.hpp.
|
protected |
Definition at line 273 of file Emitter.hpp.
|
protected |
Definition at line 267 of file Emitter.hpp.
|
protected |
Definition at line 265 of file Emitter.hpp.
1.8.11