Brunot
Loading...
Searching...
No Matches
Particle Struct Reference

Struct for passing around all the data a particle has, before a particle is added to a Particle Block. More...

#include <Particle.h>

Collaboration diagram for Particle:
[legend]

Public Attributes

Vector4D position = {0.f, 0.f, 0.f, 1.f}
Vector4D velocity = {0.f, 0.f, 0.f, 0.f}
Vector4D velocityBegin = {0.f, 0.f, 0.f, 0.f}
Vector4D velocityEnd = {0.f, 0.f, 0.f, 0.f}
Vector4D scale = {1.f, 1.f, 0.f, 0.f}
Vector4D scaleBegin = {1.f, 1.f, 0.f, 0.f}
Vector4D scaleEnd = {1.f, 1.f, 0.f, 0.f}
float rotation = 0.f
float rotationalVelocity = 0.f
float rotationalAcceleration = 0.f
Vector4D color = {1.f, 1.f, 1.f, 1.f}
Vector4D colorBegin = {1.f, 1.f, 1.f, 1.f}
Vector4D colorEnd = {1.f, 1.f, 1.f, 1.f}
unsigned frame = 0u
 the frame the particle is currently on
float frameCountdown = 0.f
 how many seconds until the next frame starts
float lifetime = 1.f
 how long the particle will live for
float timeLeft = -1.f
 how long the particle has before death, if 0 or less, particle is inactive
float fps = 0.f
 how many frames per second the animation on a particle should be.
bool velocityChanges = false
 whether the velocity should change for the particle.
th::Bezier velocityCurve
 if velocityChanges, then velocityCurve dictates how the particle should interpolate between the start and end velocity.
bool colorChanges = false
 whether the color should change for the particle.
th::Bezier colorCurve
 if colorChanges, then colorCurve dictates how the particle should interpolate between the start and end color.
bool scaleChanges = false
 whether the color should change for the particle.
th::Bezier scaleCurve
 if scaleChanges, then scaleCurve dictates how the particle should interpolate between the start and end scale.
bool loopingSprite = true
 whether the sprite loops or not.
gfx::Texturetexture = nullptr
 Texture for the particle.
gfx::Shadershader = nullptr
 Shader for the particle.
gfx::Meshmesh = nullptr
 Mesh for the particle.

Friends

auto to_json (json &j, const Particle &n) -> void
auto from_json (const json &j, Particle &n) -> void

Detailed Description

Struct for passing around all the data a particle has, before a particle is added to a Particle Block.

If this struct is updated, there's a couple places you'll need to update

◆ from_json

auto from_json ( const json & j,
Particle & n )->void
friend

◆ to_json

auto to_json ( json & j,
const Particle & n )->void
friend

Member Data Documentation

◆ color

Vector4D Particle::color = {1.f, 1.f, 1.f, 1.f}

◆ colorBegin

Vector4D Particle::colorBegin = {1.f, 1.f, 1.f, 1.f}

◆ colorChanges

bool Particle::colorChanges = false

whether the color should change for the particle.

this value is consistent for every particle in a block

◆ colorCurve

th::Bezier Particle::colorCurve

if colorChanges, then colorCurve dictates how the particle should interpolate between the start and end color.

this value is consistent for every particle in a block

◆ colorEnd

Vector4D Particle::colorEnd = {1.f, 1.f, 1.f, 1.f}

◆ fps

float Particle::fps = 0.f

how many frames per second the animation on a particle should be.

0 means no animation. this value is consistent for every particle in a block

◆ frame

unsigned Particle::frame = 0u

the frame the particle is currently on

◆ frameCountdown

float Particle::frameCountdown = 0.f

how many seconds until the next frame starts

◆ lifetime

float Particle::lifetime = 1.f

how long the particle will live for

◆ loopingSprite

bool Particle::loopingSprite = true

whether the sprite loops or not.

this value is consistent for every particle in a block

◆ mesh

gfx::Mesh* Particle::mesh = nullptr

Mesh for the particle.

this value is consistent for every particle in a block

◆ position

Vector4D Particle::position = {0.f, 0.f, 0.f, 1.f}

◆ rotation

float Particle::rotation = 0.f

◆ rotationalAcceleration

float Particle::rotationalAcceleration = 0.f

◆ rotationalVelocity

float Particle::rotationalVelocity = 0.f

◆ scale

Vector4D Particle::scale = {1.f, 1.f, 0.f, 0.f}

◆ scaleBegin

Vector4D Particle::scaleBegin = {1.f, 1.f, 0.f, 0.f}

◆ scaleChanges

bool Particle::scaleChanges = false

whether the color should change for the particle.

this value is consistent for every particle in a block

◆ scaleCurve

th::Bezier Particle::scaleCurve

if scaleChanges, then scaleCurve dictates how the particle should interpolate between the start and end scale.

this value is consistent for every particle in a block

◆ scaleEnd

Vector4D Particle::scaleEnd = {1.f, 1.f, 0.f, 0.f}

◆ shader

gfx::Shader* Particle::shader = nullptr

Shader for the particle.

this value is consistent for every particle in a block

◆ texture

gfx::Texture* Particle::texture = nullptr

Texture for the particle.

this value is consistent for every particle in a block.

◆ timeLeft

float Particle::timeLeft = -1.f

how long the particle has before death, if 0 or less, particle is inactive

◆ velocity

Vector4D Particle::velocity = {0.f, 0.f, 0.f, 0.f}

◆ velocityBegin

Vector4D Particle::velocityBegin = {0.f, 0.f, 0.f, 0.f}

◆ velocityChanges

bool Particle::velocityChanges = false

whether the velocity should change for the particle.

this value is consistent for every particle in a block.

◆ velocityCurve

th::Bezier Particle::velocityCurve

if velocityChanges, then velocityCurve dictates how the particle should interpolate between the start and end velocity.

this value is consistent for every particle in a block.

◆ velocityEnd

Vector4D Particle::velocityEnd = {0.f, 0.f, 0.f, 0.f}

The documentation for this struct was generated from the following file:
  • /home/egrazil/sites/Brunot/The House/source/Graphics/Particle.h