Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Engine::Particle Class Reference

#include <Particle.hpp>

Classes

struct  BillboardData
 
struct  LineData
 
struct  MeshData
 
struct  ParticleData
 

Public Types

enum  ParticleType { ParticleType::LINE = 0, ParticleType::BILLBOARD, ParticleType::MESH }
 
enum  InterpolateType { InterpolateType::START = 0, InterpolateType::END, InterpolateType::LINEAR, InterpolateType::QUADRATIC }
 
enum  BlendMode { BlendMode::ALPHA = 0, BlendMode::ADDATIVE, BlendMode::SOLID }
 
enum  LineEndAction {
  LineEndAction::STOP = 0, LineEndAction::REMOVE_FIRST, LineEndAction::REMOVE_SECOND, LineEndAction::REMOVE_LAST,
  LineEndAction::DESTROY
}
 

Public Member Functions

 Particle ()
 
 ~Particle ()
 
void SetParticleType (ParticleType type)
 Sets the type of the particle. More...
 
ParticleType GetParticleType () const
 Returns the type of the particle. More...
 
void SetBlendMode (BlendMode mode)
 Sets the blend mode of the particle. More...
 
BlendMode GetParticleBlendMode () const
 Returns the blend mode of the particle. More...
 
void SetStartColor (glm::vec4 colorMin, glm::vec4 colorMax)
 Sets the range of possible start colors of the particle. More...
 
eastl::pair< glm::vec4, glm::vec4 > GetStartColor ()
 Returns a pair containing the range of possible start colors of the particle. More...
 
void SetEndColor (glm::vec4 colorMin, glm::vec4 colorMax)
 Sets the range of possible end colors of the particle. More...
 
eastl::pair< glm::vec4, glm::vec4 > GetEndColor ()
 Returns a pair containing the range of possible end colors of the particle. More...
 
void SetColorInterpolateType (InterpolateType type)
 Sets the interpolation type used for the color. More...
 
InterpolateType GetColorInterpolateType () const
 Returns the interpolation type used for the color. More...
 
void SetForce (glm::vec3 forceMin, glm::vec3 forceMax)
 Sets the min and max for the range of forces that can be applied on the particle. More...
 
eastl::pair< glm::vec3, glm::vec3 > GetForce ()
 Returns a pair containing the range of possible forces that can be applied on the particle. More...
 
void SetLifetime (float lifetimeMin, float lifetimeMax)
 Sets the range of possible lifetimes the particle can have. More...
 
eastl::pair< float, float > GetLifetime ()
 Returns the range of possible lifetimes the particle can have. More...
 
void SetSpeed (float speedMin, float speedMax)
 Sets the range of possible speeds the particle can be created with. More...
 
eastl::pair< float, float > GetSpeed ()
 Returns the range of possible speeds the particle can be created with. More...
 
void SetMass (float massMin, float massMax)
 Sets the range of masses a particle can be created with. NOTE: If the mass is zero forces won't interact with the particle, to prevent particles from gaining infinite speed as soon as they encounter a force. More...
 
eastl::pair< float, float > GetMass ()
 Returns the range of possible masses the particle can be created with. More...
 
void SetGravityEnabled (bool gravity)
 Turns gravity on and off for the particle. Gravitic constant will be 9.81. If you want different gravities, turn this off and instead specify a force for the particle. More...
 
bool IsGravityEnabled () const
 Returns whether or not gravity is enabled for the particle. More...
 
void SetTexture (eastl::weak_ptr< Texture > texture)
 Sets the texture of the particle. Only applies to lines and billboards. Can be left empty to use just the particle color. More...
 
eastl::weak_ptr< TextureGetTexture () const
 Returns the texture used by the particle. More...
 
bool HasTexture () const
 Returns whether or not the particle has a texture. More...
 
void SetLineMaxSegments (int segments)
 Sets the maximum amount of segments a line particle can have. More...
 
int GetLineMaxSegments () const
 Returns the maximum number of segments a line particle can have. More...
 
void SetNewSegmentsPerFrame (int segments)
 Sets the amount of new segments that get created each frame. More...
 
int GetNewSegmentsPerFrame () const
 Returns the ammount of new segments that get created each frame. More...
 
void SetLineEndAction (LineEndAction action)
 Sets the action that should be taken when trying to create segments after having reached the maximum amount of segments. More...
 
LineEndAction GetLineEndAction () const
 Returns the action that should be taken when trying to create segments after having reached the maximum amount of segments. More...
 
void SetLineStartThickness (float thicknessMin, float thicknessMax)
 Sets the range of thicknesses a line can start with (interpolation is based on lifetime, not segment count). More...
 
eastl::pair< float, float > GetLineStartThickness ()
 Returns the range of thicknesses a line can start with. More...
 
void SetLineEndthickness (float thicknessMin, float thicknessMax)
 Sets the range of thicknesses a line can end with (interpolation is based on lifetime, not segment count). More...
 
eastl::pair< float, float > GetLineEndThickness ()
 Returns the range of thicknesses a line can end with. More...
 
void SetLineThicknessInterpolateType (InterpolateType type)
 Sets the interpolation type of the line thickness. More...
 
InterpolateType GetLineThicknessInterpolateType () const
 Returns the interpolation type of the line thickness. More...
 
void SetBillboardSizeStart (glm::vec2 sizeMin, glm::vec2 sizeMax)
 Sets the range for start size of the billboard. More...
 
eastl::pair< glm::vec2, glm::vec2 > GetBillboardSizeStart ()
 Returns the range of start sizes for the billboard. More...
 
void SetBillboardSizeEnd (glm::vec2 sizeMin, glm::vec2 sizeMax)
 Sets the range for the end size of the billboard. More...
 
eastl::pair< glm::vec2, glm::vec2 > GetBillboardSizeEnd ()
 Returns the range of end sizes for the billboard. More...
 
void SetBillboardSizeInterpolateType (InterpolateType type)
 Sets the interpolation type for the billboard size. More...
 
InterpolateType GetBillboardSizeInterpolateType () const
 Returns the interpolation type for the billboard size. More...
 
void SetBillboardRollSpeedStart (float speedMin, float speedMax)
 Sets the range of roll rotation speeds the billboard can start with. More...
 
eastl::pair< float, float > GetBillboardRollSpeedStart ()
 Returns the angle of roll rotation speeds the billboard can start with. More...
 
void SetBillboardRollSpeedEnd (float speedMin, float speedMax)
 Sets the range of roll rotation speeds the billboard can end with. More...
 
eastl::pair< float, float > GetBillboardRollSpeedEnd ()
 Returns the angle of roll rotation speeds the billboard can end with. More...
 
void SetBillboardRoll (float rollMin, float rollMax)
 Sets the range of roll rotations the billboard can start with. More...
 
eastl::pair< float, float > GetBillboardRoll ()
 Returns the range of roll rotations the billboard can start with. More...
 
void SetBillboardRollSpeedInterpolateType (InterpolateType type)
 Sets the interpolation type for the roll speed. More...
 
InterpolateType GetBillboardRollSpeedInterpolateType () const
 Returns the interpolation type for the roll speed. More...
 
void SetMesh (eastl::weak_ptr< Mesh > mesh)
 Sets the mesh used for mesh particles. More...
 
eastl::weak_ptr< MeshGetMesh () const
 Returns the mesh used for mesh particles. More...
 
void SetMaterial (eastl::weak_ptr< Material > material)
 Sets the material used for the mesh. Material color is overriden by the particle color. More...
 
eastl::weak_ptr< MaterialGetMaterial () const
 Returns the material used for the mesh. More...
 
void SetMeshScaleStart (glm::vec3 scaleMin, glm::vec3 scaleMax)
 Sets the range for start scale of the mesh. More...
 
eastl::pair< glm::vec3, glm::vec3 > GetMeshScaleStart ()
 Returns the range of start scales for the mesh. More...
 
void SetMeshScaleEnd (glm::vec3 scaleMin, glm::vec3 scaleMax)
 Sets the range for the end scale of the mesh. More...
 
eastl::pair< glm::vec3, glm::vec3 > GetMeshScaleEnd ()
 Returns the range of end scales for the mesh. More...
 
void SetMeshScaleInterpolateType (InterpolateType type)
 Sets the interpolation type for the mesh scale. More...
 
InterpolateType GetMeshScaleInterpolateType () const
 Returns the interpolation type for the mesh scale. More...
 
void SetMeshRotationSpeedStart (glm::vec3 speedMin, glm::vec3 speedMax)
 Sets the range of rotation speeds in euler angles the mesh can start with. More...
 
eastl::pair< glm::vec3, glm::vec3 > GetMeshRotationSpeedStart ()
 Returns the rotation speeds in euler angles the mesh can start with. More...
 
void SetMeshRotationSpeedEnd (glm::vec3 speedMin, glm::vec3 speedMax)
 Sets the range of rotation speeds in euler angles the mesh can end with. More...
 
eastl::pair< glm::vec3, glm::vec3 > GetMeshRotationSpeedEnd ()
 Returns the rotation speeds in euler angles the mesh can end with. More...
 
void SetMeshRotation (glm::vec3 rotationMin, glm::vec3 rotationMax)
 Sets the range of rotations in euler angles the mesh can start with. More...
 
eastl::pair< glm::vec3, glm::vec3 > GetMeshRotation ()
 Returns the range of rotations in euler angles the mesh can start with. More...
 
void SetMeshRotationSpeedInterpolateType (InterpolateType type)
 Sets the interpolation type for the rotation speed. More...
 
InterpolateType GetMeshRotationSpeedInterpolateType () const
 Returns the interpolation type for the rotation speed. More...
 
void SetMeshLit (bool lit)
 Sets whether or not the lightning calculations will be done when rendering the mesh. NOTE: Only works for mesh particles. More...
 
bool IsMeshLit () const
 Returns whether or not the lightning calculations will be done when rendering the mesh. More...
 
void SetCastsShadows (bool castShadows)
 Sets whether or not the particle can cast shadows. NOTE: This only works for mesh particles. WARNING: This will cause a lot of additional calculations, especially when using higher complexity meshes. Only use this when absolutely neseccary. More...
 
bool CanCastShadows () const
 Returns whether or not the particle can cast shadows. More...
 

Protected Member Functions

ParticleData CreateParticle (glm::vec4 position, glm::vec4 direction) const
 
LineData CreateParticleLineData () const
 
BillboardData CreateParticleBillboardData () const
 
MeshData CreateParticleMeshData () const
 
float RandomFloatLinear (float min, float max) const
 

Protected Attributes

ParticleType particleType
 
BlendMode particleBlendMode
 
glm::vec4 startColorMin
 
glm::vec4 startColorMax
 
glm::vec4 endColorMin
 
glm::vec4 endColorMax
 
InterpolateType colorInterpolateType
 
glm::vec4 forceMin
 
glm::vec4 forceMax
 
float lifetimeMin
 
float lifetimeMax
 
float speedMin
 
float speedMax
 
float massMin
 
float massMax
 
bool gravity = false
 
eastl::weak_ptr< Texturetexture
 
bool textured = false
 
int maxSegments
 
int newSegmentsPerFrame
 
LineEndAction lineEndAction
 
float startLineThicknessMin
 
float startLineThicknessMax
 
float endLineThicknessMin
 
float endLineThicknessMax
 
InterpolateType lineThicknessInterpolateType
 
glm::vec2 startSizeMin
 
glm::vec2 startSizeMax
 
glm::vec2 endSizeMin
 
glm::vec2 endSizeMax
 
InterpolateType sizeInterpolateType
 
float startRollSpeedMin
 
float startRollSpeedMax
 
float endRollSpeedMin
 
float endRollSpeedMax
 
InterpolateType rollSpeedInterpolateType
 
float rollMin
 
float rollMax
 
eastl::weak_ptr< Meshmesh
 
eastl::weak_ptr< Materialmaterial
 
glm::vec4 startScaleMin
 
glm::vec4 startScaleMax
 
glm::vec4 endScaleMin
 
glm::vec4 endScaleMax
 
InterpolateType scaleInterpolateType
 
glm::vec4 startRotationSpeedMin
 
glm::vec4 startRotationSpeedMax
 
glm::vec4 endRotationSpeedMin
 
glm::vec4 endRotationSpeedMax
 
InterpolateType rotationSpeedInterpolateType
 
glm::vec4 rotationMin
 
glm::vec4 rotationMax
 
bool meshLit
 
bool castShadows
 

Friends

class Emitter
 

Detailed Description

Definition at line 14 of file Particle.hpp.

Member Enumeration Documentation

Enumerator
ALPHA 
ADDATIVE 
SOLID 

Definition at line 33 of file Particle.hpp.

Enumerator
START 
END 
LINEAR 
QUADRATIC 

Definition at line 26 of file Particle.hpp.

Enumerator
STOP 
REMOVE_FIRST 
REMOVE_SECOND 
REMOVE_LAST 
DESTROY 

Definition at line 39 of file Particle.hpp.

Enumerator
LINE 
BILLBOARD 
MESH 

Definition at line 20 of file Particle.hpp.

Constructor & Destructor Documentation

Engine::Particle::Particle ( )

Definition at line 9 of file Particle.cpp.

Engine::Particle::~Particle ( )

Definition at line 20 of file Particle.cpp.

Member Function Documentation

bool Engine::Particle::CanCastShadows ( ) const

Returns whether or not the particle can cast shadows.

Returns
Whether or not the particle can cast shadows.

Definition at line 396 of file Particle.cpp.

Particle::ParticleData Engine::Particle::CreateParticle ( glm::vec4  position,
glm::vec4  direction 
) const
protected

Definition at line 401 of file Particle.cpp.

Particle::BillboardData Engine::Particle::CreateParticleBillboardData ( ) const
protected

Definition at line 434 of file Particle.cpp.

Particle::LineData Engine::Particle::CreateParticleLineData ( ) const
protected

Definition at line 421 of file Particle.cpp.

Particle::MeshData Engine::Particle::CreateParticleMeshData ( ) const
protected

Definition at line 454 of file Particle.cpp.

eastl::pair< float, float > Engine::Particle::GetBillboardRoll ( )

Returns the range of roll rotations the billboard can start with.

Returns
A pair of floats containing the range.

Definition at line 271 of file Particle.cpp.

eastl::pair< float, float > Engine::Particle::GetBillboardRollSpeedEnd ( )

Returns the angle of roll rotation speeds the billboard can end with.

Returns
A pair of floats containing the range of speeds.

Definition at line 260 of file Particle.cpp.

Particle::InterpolateType Engine::Particle::GetBillboardRollSpeedInterpolateType ( ) const

Returns the interpolation type for the roll speed.

Returns
The interpolation type.

Definition at line 281 of file Particle.cpp.

eastl::pair< float, float > Engine::Particle::GetBillboardRollSpeedStart ( )

Returns the angle of roll rotation speeds the billboard can start with.

Returns
A pair of floats containing the range of speeds.

Definition at line 249 of file Particle.cpp.

eastl::pair< glm::vec2, glm::vec2 > Engine::Particle::GetBillboardSizeEnd ( )

Returns the range of end sizes for the billboard.

Returns
A pair of vec2s containing the range of sizes.

Definition at line 228 of file Particle.cpp.

Particle::InterpolateType Engine::Particle::GetBillboardSizeInterpolateType ( ) const

Returns the interpolation type for the billboard size.

Returns
The interpolation type.

Definition at line 238 of file Particle.cpp.

eastl::pair< glm::vec2, glm::vec2 > Engine::Particle::GetBillboardSizeStart ( )

Returns the range of start sizes for the billboard.

Returns
A pair of vec2s containing the size.

Definition at line 217 of file Particle.cpp.

Particle::InterpolateType Engine::Particle::GetColorInterpolateType ( ) const

Returns the interpolation type used for the color.

Returns
The interpolation type used for the color.

Definition at line 71 of file Particle.cpp.

eastl::pair< glm::vec4, glm::vec4 > Engine::Particle::GetEndColor ( )

Returns a pair containing the range of possible end colors of the particle.

Returns
An eastl pair containing the range of colors.

Definition at line 61 of file Particle.cpp.

eastl::pair< glm::vec3, glm::vec3 > Engine::Particle::GetForce ( )

Returns a pair containing the range of possible forces that can be applied on the particle.

Returns
A pair containing a range of forces.

Definition at line 82 of file Particle.cpp.

eastl::pair< float, float > Engine::Particle::GetLifetime ( )

Returns the range of possible lifetimes the particle can have.

Returns
A pair containing a range of lifetimes.

Definition at line 93 of file Particle.cpp.

Particle::LineEndAction Engine::Particle::GetLineEndAction ( ) const

Returns the action that should be taken when trying to create segments after having reached the maximum amount of segments.

Returns
The action that should be taken.

Definition at line 174 of file Particle.cpp.

eastl::pair< float, float > Engine::Particle::GetLineEndThickness ( )

Returns the range of thicknesses a line can end with.

Returns
A pair of floats containing the range.

Definition at line 196 of file Particle.cpp.

int Engine::Particle::GetLineMaxSegments ( ) const

Returns the maximum number of segments a line particle can have.

Returns
The maximum number of segments.

Definition at line 154 of file Particle.cpp.

eastl::pair< float, float > Engine::Particle::GetLineStartThickness ( )

Returns the range of thicknesses a line can start with.

Returns
A pair of floats containing the range.

Definition at line 185 of file Particle.cpp.

Particle::InterpolateType Engine::Particle::GetLineThicknessInterpolateType ( ) const

Returns the interpolation type of the line thickness.

Returns
The interpolation type.

Definition at line 206 of file Particle.cpp.

eastl::pair< float, float > Engine::Particle::GetMass ( )

Returns the range of possible masses the particle can be created with.

Returns
A pair containing a range of masses.

Definition at line 115 of file Particle.cpp.

eastl::weak_ptr< Material > Engine::Particle::GetMaterial ( ) const

Returns the material used for the mesh.

Returns
The mesh material.

Definition at line 301 of file Particle.cpp.

eastl::weak_ptr< Mesh > Engine::Particle::GetMesh ( ) const

Returns the mesh used for mesh particles.

Returns
The mesh.

Definition at line 291 of file Particle.cpp.

eastl::pair< glm::vec3, glm::vec3 > Engine::Particle::GetMeshRotation ( )

Returns the range of rotations in euler angles the mesh can start with.

Returns
A pair of vec3s containing the range.

Definition at line 366 of file Particle.cpp.

eastl::pair< glm::vec3, glm::vec3 > Engine::Particle::GetMeshRotationSpeedEnd ( )

Returns the rotation speeds in euler angles the mesh can end with.

Returns
A pair of vec3s containing the range of speeds.

Definition at line 355 of file Particle.cpp.

Particle::InterpolateType Engine::Particle::GetMeshRotationSpeedInterpolateType ( ) const

Returns the interpolation type for the rotation speed.

Returns
The interpolation type.

Definition at line 376 of file Particle.cpp.

eastl::pair< glm::vec3, glm::vec3 > Engine::Particle::GetMeshRotationSpeedStart ( )

Returns the rotation speeds in euler angles the mesh can start with.

Returns
A pair of glm::vec3s containing the range of speeds.

Definition at line 344 of file Particle.cpp.

eastl::pair< glm::vec3, glm::vec3 > Engine::Particle::GetMeshScaleEnd ( )

Returns the range of end scales for the mesh.

Returns
A pair of vec3s containing the range of scales.

Definition at line 323 of file Particle.cpp.

Particle::InterpolateType Engine::Particle::GetMeshScaleInterpolateType ( ) const

Returns the interpolation type for the mesh scale.

Returns
The interpolation type.

Definition at line 333 of file Particle.cpp.

eastl::pair< glm::vec3, glm::vec3 > Engine::Particle::GetMeshScaleStart ( )

Returns the range of start scales for the mesh.

Returns
A pair of vec3s containing the scale.

Definition at line 312 of file Particle.cpp.

int Engine::Particle::GetNewSegmentsPerFrame ( ) const

Returns the ammount of new segments that get created each frame.

Returns
The amount of new segments.

Definition at line 164 of file Particle.cpp.

Particle::BlendMode Engine::Particle::GetParticleBlendMode ( ) const

Returns the blend mode of the particle.

Returns
The particle blend mode.

Definition at line 39 of file Particle.cpp.

Particle::ParticleType Engine::Particle::GetParticleType ( ) const

Returns the type of the particle.

Returns
The particle type.

Definition at line 29 of file Particle.cpp.

eastl::pair< float, float > Engine::Particle::GetSpeed ( )

Returns the range of possible speeds the particle can be created with.

Returns
A pair containing a range of speeds.

Definition at line 104 of file Particle.cpp.

eastl::pair< glm::vec4, glm::vec4 > Engine::Particle::GetStartColor ( )

Returns a pair containing the range of possible start colors of the particle.

Returns
An eastl pair containing the range of colors.

Definition at line 50 of file Particle.cpp.

eastl::weak_ptr< Texture > Engine::Particle::GetTexture ( ) const

Returns the texture used by the particle.

Returns
A weak pointer to a texture.

Definition at line 139 of file Particle.cpp.

bool Engine::Particle::HasTexture ( ) const

Returns whether or not the particle has a texture.

Returns
A bool indicating whether or not the particle has a texture.

Definition at line 144 of file Particle.cpp.

bool Engine::Particle::IsGravityEnabled ( ) const

Returns whether or not gravity is enabled for the particle.

Returns

Definition at line 125 of file Particle.cpp.

bool Engine::Particle::IsMeshLit ( ) const

Returns whether or not the lightning calculations will be done when rendering the mesh.

Returns
Bool indicating whether or not the lightning calculations will be done.

Definition at line 386 of file Particle.cpp.

float Engine::Particle::RandomFloatLinear ( float  min,
float  max 
) const
protected

Definition at line 474 of file Particle.cpp.

void Engine::Particle::SetBillboardRoll ( float  rollMin,
float  rollMax 
)

Sets the range of roll rotations the billboard can start with.

Parameters
rollMinThe minimum rotation.
rollMaxThe maximum rotation.

Definition at line 265 of file Particle.cpp.

void Engine::Particle::SetBillboardRollSpeedEnd ( float  speedMin,
float  speedMax 
)

Sets the range of roll rotation speeds the billboard can end with.

Parameters
speedMinThe minimum speed.
speedMaxThe maximum speed.

Definition at line 254 of file Particle.cpp.

void Engine::Particle::SetBillboardRollSpeedInterpolateType ( InterpolateType  type)

Sets the interpolation type for the roll speed.

Parameters
typeThe interpolation type.

Definition at line 276 of file Particle.cpp.

void Engine::Particle::SetBillboardRollSpeedStart ( float  speedMin,
float  speedMax 
)

Sets the range of roll rotation speeds the billboard can start with.

Parameters
speedMinThe minimum speed.
speedMaxThe maximum speed.

Definition at line 243 of file Particle.cpp.

void Engine::Particle::SetBillboardSizeEnd ( glm::vec2  sizeMin,
glm::vec2  sizeMax 
)

Sets the range for the end size of the billboard.

Parameters
sizeMinThe minimum size.
sizeMaxThe maximum size.

Definition at line 222 of file Particle.cpp.

void Engine::Particle::SetBillboardSizeInterpolateType ( InterpolateType  type)

Sets the interpolation type for the billboard size.

Parameters
typeThe interpolation type.

Definition at line 233 of file Particle.cpp.

void Engine::Particle::SetBillboardSizeStart ( glm::vec2  sizeMin,
glm::vec2  sizeMax 
)

Sets the range for start size of the billboard.

Parameters
sizeMinThe minimum size.
sizeMaxThe maximum size.

Definition at line 211 of file Particle.cpp.

void Engine::Particle::SetBlendMode ( BlendMode  mode)

Sets the blend mode of the particle.

Parameters
modeThe new blend mode.

Definition at line 34 of file Particle.cpp.

void Engine::Particle::SetCastsShadows ( bool  castShadows)

Sets whether or not the particle can cast shadows. NOTE: This only works for mesh particles. WARNING: This will cause a lot of additional calculations, especially when using higher complexity meshes. Only use this when absolutely neseccary.

Parameters
castShadowsBool indicating whether or not the mesh should cast shadows.

Definition at line 391 of file Particle.cpp.

void Engine::Particle::SetColorInterpolateType ( InterpolateType  type)

Sets the interpolation type used for the color.

Parameters
typeThe interpolation type used for the color.

Definition at line 66 of file Particle.cpp.

void Engine::Particle::SetEndColor ( glm::vec4  colorMin,
glm::vec4  colorMax 
)

Sets the range of possible end colors of the particle.

Parameters
colorMinThe lowest possible color in the range.
colorMaxThe highest possible color in the range.

Definition at line 55 of file Particle.cpp.

void Engine::Particle::SetForce ( glm::vec3  forceMin,
glm::vec3  forceMax 
)

Sets the min and max for the range of forces that can be applied on the particle.

Parameters
forceMinThe lowest possible force the particle can be created with.
forceMaxThe hightest possible force the particle can be created with.

Definition at line 76 of file Particle.cpp.

void Engine::Particle::SetGravityEnabled ( bool  gravity)

Turns gravity on and off for the particle. Gravitic constant will be 9.81. If you want different gravities, turn this off and instead specify a force for the particle.

Parameters
gravityWhether or not gravity should be used.

Definition at line 120 of file Particle.cpp.

void Engine::Particle::SetLifetime ( float  lifetimeMin,
float  lifetimeMax 
)

Sets the range of possible lifetimes the particle can have.

Parameters
lifetimeMinThe lowest possible lifetime.
lifetimeMaxThe highest possible lifetime.

Definition at line 87 of file Particle.cpp.

void Engine::Particle::SetLineEndAction ( LineEndAction  action)

Sets the action that should be taken when trying to create segments after having reached the maximum amount of segments.

Parameters
actionThe action that should be taken.

Definition at line 169 of file Particle.cpp.

void Engine::Particle::SetLineEndthickness ( float  thicknessMin,
float  thicknessMax 
)

Sets the range of thicknesses a line can end with (interpolation is based on lifetime, not segment count).

Parameters
thicknessMinThe minimum thickness.
thicknessMaxThe maximum thickness.

Definition at line 190 of file Particle.cpp.

void Engine::Particle::SetLineMaxSegments ( int  segments)

Sets the maximum amount of segments a line particle can have.

Parameters
segmentsThe maximum number of segments.

Definition at line 149 of file Particle.cpp.

void Engine::Particle::SetLineStartThickness ( float  thicknessMin,
float  thicknessMax 
)

Sets the range of thicknesses a line can start with (interpolation is based on lifetime, not segment count).

Parameters
thicknessMinThe minimum thickness.
thicknessMaxThe maximum thickness.

Definition at line 179 of file Particle.cpp.

void Engine::Particle::SetLineThicknessInterpolateType ( InterpolateType  type)

Sets the interpolation type of the line thickness.

Parameters
typeThe interpolation type.

Definition at line 201 of file Particle.cpp.

void Engine::Particle::SetMass ( float  massMin,
float  massMax 
)

Sets the range of masses a particle can be created with. NOTE: If the mass is zero forces won't interact with the particle, to prevent particles from gaining infinite speed as soon as they encounter a force.

Parameters
massMinThe lowest possible mass.
massMaxThe highest possible mass.

Definition at line 109 of file Particle.cpp.

void Engine::Particle::SetMaterial ( eastl::weak_ptr< Material material)

Sets the material used for the mesh. Material color is overriden by the particle color.

Parameters
materialThe mesh material.

Definition at line 296 of file Particle.cpp.

void Engine::Particle::SetMesh ( eastl::weak_ptr< Mesh mesh)

Sets the mesh used for mesh particles.

Parameters
meshThe new mesh.

Definition at line 286 of file Particle.cpp.

void Engine::Particle::SetMeshLit ( bool  lit)

Sets whether or not the lightning calculations will be done when rendering the mesh. NOTE: Only works for mesh particles.

Parameters
litBool indicating whether or not the lightning calculations will be done.

Definition at line 381 of file Particle.cpp.

void Engine::Particle::SetMeshRotation ( glm::vec3  rotationMin,
glm::vec3  rotationMax 
)

Sets the range of rotations in euler angles the mesh can start with.

Parameters
rotationMinThe minimum rotation.
rotationMaxThe maximum rotation.

Definition at line 360 of file Particle.cpp.

void Engine::Particle::SetMeshRotationSpeedEnd ( glm::vec3  speedMin,
glm::vec3  speedMax 
)

Sets the range of rotation speeds in euler angles the mesh can end with.

Parameters
speedMinThe minimum speed.
speedMaxThe maximum speed.

Definition at line 349 of file Particle.cpp.

void Engine::Particle::SetMeshRotationSpeedInterpolateType ( InterpolateType  type)

Sets the interpolation type for the rotation speed.

Parameters
typeThe interpolation type.

Definition at line 371 of file Particle.cpp.

void Engine::Particle::SetMeshRotationSpeedStart ( glm::vec3  speedMin,
glm::vec3  speedMax 
)

Sets the range of rotation speeds in euler angles the mesh can start with.

Parameters
speedMinThe minimum speed.
speedMaxThe maximum speed.

Definition at line 338 of file Particle.cpp.

void Engine::Particle::SetMeshScaleEnd ( glm::vec3  scaleMin,
glm::vec3  scaleMax 
)

Sets the range for the end scale of the mesh.

Parameters
scaleMinThe minimum scale.
scaleMaxThe maximum scale.

Definition at line 317 of file Particle.cpp.

void Engine::Particle::SetMeshScaleInterpolateType ( InterpolateType  type)

Sets the interpolation type for the mesh scale.

Parameters
typeThe interpolation type.

Definition at line 328 of file Particle.cpp.

void Engine::Particle::SetMeshScaleStart ( glm::vec3  scaleMin,
glm::vec3  scaleMax 
)

Sets the range for start scale of the mesh.

Parameters
scaleMinThe minimum scale.
scaleMaxThe maximum scale.

Definition at line 306 of file Particle.cpp.

void Engine::Particle::SetNewSegmentsPerFrame ( int  segments)

Sets the amount of new segments that get created each frame.

Parameters
segmentsThe amount of new segments.

Definition at line 159 of file Particle.cpp.

void Engine::Particle::SetParticleType ( ParticleType  type)

Sets the type of the particle.

Parameters
typeThe new type.

Definition at line 24 of file Particle.cpp.

void Engine::Particle::SetSpeed ( float  speedMin,
float  speedMax 
)

Sets the range of possible speeds the particle can be created with.

Parameters
speedMinThe lowest possible speed.
speedMaxThe highest possible speed.

Definition at line 98 of file Particle.cpp.

void Engine::Particle::SetStartColor ( glm::vec4  colorMin,
glm::vec4  colorMax 
)

Sets the range of possible start colors of the particle.

Parameters
colorMinThe lowest possible color in the range.
colorMaxThe highest possible color in the range.

Definition at line 44 of file Particle.cpp.

void Engine::Particle::SetTexture ( eastl::weak_ptr< Texture texture)

Sets the texture of the particle. Only applies to lines and billboards. Can be left empty to use just the particle color.

Parameters
textureA weak pointer to the texture.

Definition at line 130 of file Particle.cpp.

Friends And Related Function Documentation

friend class Emitter
friend

Definition at line 496 of file Particle.hpp.

Member Data Documentation

bool Engine::Particle::castShadows
protected

Definition at line 601 of file Particle.hpp.

InterpolateType Engine::Particle::colorInterpolateType
protected

Definition at line 554 of file Particle.hpp.

glm::vec4 Engine::Particle::endColorMax
protected

Definition at line 553 of file Particle.hpp.

glm::vec4 Engine::Particle::endColorMin
protected

Definition at line 553 of file Particle.hpp.

float Engine::Particle::endLineThicknessMax
protected

Definition at line 574 of file Particle.hpp.

float Engine::Particle::endLineThicknessMin
protected

Definition at line 574 of file Particle.hpp.

float Engine::Particle::endRollSpeedMax
protected

Definition at line 582 of file Particle.hpp.

float Engine::Particle::endRollSpeedMin
protected

Definition at line 582 of file Particle.hpp.

glm::vec4 Engine::Particle::endRotationSpeedMax
protected

Definition at line 595 of file Particle.hpp.

glm::vec4 Engine::Particle::endRotationSpeedMin
protected

Definition at line 595 of file Particle.hpp.

glm::vec4 Engine::Particle::endScaleMax
protected

Definition at line 591 of file Particle.hpp.

glm::vec4 Engine::Particle::endScaleMin
protected

Definition at line 591 of file Particle.hpp.

glm::vec2 Engine::Particle::endSizeMax
protected

Definition at line 578 of file Particle.hpp.

glm::vec2 Engine::Particle::endSizeMin
protected

Definition at line 578 of file Particle.hpp.

glm::vec4 Engine::Particle::forceMax
protected

Definition at line 556 of file Particle.hpp.

glm::vec4 Engine::Particle::forceMin
protected

Definition at line 556 of file Particle.hpp.

bool Engine::Particle::gravity = false
protected

Definition at line 562 of file Particle.hpp.

float Engine::Particle::lifetimeMax
protected

Definition at line 558 of file Particle.hpp.

float Engine::Particle::lifetimeMin
protected

Definition at line 558 of file Particle.hpp.

LineEndAction Engine::Particle::lineEndAction
protected

Definition at line 571 of file Particle.hpp.

InterpolateType Engine::Particle::lineThicknessInterpolateType
protected

Definition at line 575 of file Particle.hpp.

float Engine::Particle::massMax
protected

Definition at line 560 of file Particle.hpp.

float Engine::Particle::massMin
protected

Definition at line 560 of file Particle.hpp.

eastl::weak_ptr<Material> Engine::Particle::material
protected

Definition at line 588 of file Particle.hpp.

int Engine::Particle::maxSegments
protected

Definition at line 568 of file Particle.hpp.

eastl::weak_ptr<Mesh> Engine::Particle::mesh
protected

Definition at line 587 of file Particle.hpp.

bool Engine::Particle::meshLit
protected

Definition at line 600 of file Particle.hpp.

int Engine::Particle::newSegmentsPerFrame
protected

Definition at line 569 of file Particle.hpp.

BlendMode Engine::Particle::particleBlendMode
protected

Definition at line 550 of file Particle.hpp.

ParticleType Engine::Particle::particleType
protected

Definition at line 549 of file Particle.hpp.

float Engine::Particle::rollMax
protected

Definition at line 585 of file Particle.hpp.

float Engine::Particle::rollMin
protected

Definition at line 585 of file Particle.hpp.

InterpolateType Engine::Particle::rollSpeedInterpolateType
protected

Definition at line 583 of file Particle.hpp.

glm::vec4 Engine::Particle::rotationMax
protected

Definition at line 598 of file Particle.hpp.

glm::vec4 Engine::Particle::rotationMin
protected

Definition at line 598 of file Particle.hpp.

InterpolateType Engine::Particle::rotationSpeedInterpolateType
protected

Definition at line 596 of file Particle.hpp.

InterpolateType Engine::Particle::scaleInterpolateType
protected

Definition at line 592 of file Particle.hpp.

InterpolateType Engine::Particle::sizeInterpolateType
protected

Definition at line 579 of file Particle.hpp.

float Engine::Particle::speedMax
protected

Definition at line 559 of file Particle.hpp.

float Engine::Particle::speedMin
protected

Definition at line 559 of file Particle.hpp.

glm::vec4 Engine::Particle::startColorMax
protected

Definition at line 552 of file Particle.hpp.

glm::vec4 Engine::Particle::startColorMin
protected

Definition at line 552 of file Particle.hpp.

float Engine::Particle::startLineThicknessMax
protected

Definition at line 573 of file Particle.hpp.

float Engine::Particle::startLineThicknessMin
protected

Definition at line 573 of file Particle.hpp.

float Engine::Particle::startRollSpeedMax
protected

Definition at line 581 of file Particle.hpp.

float Engine::Particle::startRollSpeedMin
protected

Definition at line 581 of file Particle.hpp.

glm::vec4 Engine::Particle::startRotationSpeedMax
protected

Definition at line 594 of file Particle.hpp.

glm::vec4 Engine::Particle::startRotationSpeedMin
protected

Definition at line 594 of file Particle.hpp.

glm::vec4 Engine::Particle::startScaleMax
protected

Definition at line 590 of file Particle.hpp.

glm::vec4 Engine::Particle::startScaleMin
protected

Definition at line 590 of file Particle.hpp.

glm::vec2 Engine::Particle::startSizeMax
protected

Definition at line 577 of file Particle.hpp.

glm::vec2 Engine::Particle::startSizeMin
protected

Definition at line 577 of file Particle.hpp.

eastl::weak_ptr<Texture> Engine::Particle::texture
protected

Definition at line 564 of file Particle.hpp.

bool Engine::Particle::textured = false
protected

Definition at line 566 of file Particle.hpp.


The documentation for this class was generated from the following files: