41 virtual Particle newParticle(
size_t anim,
size_t time,
float w,
float l,
float spd,
float var,
float spr,
55 Particle newParticle(
size_t anim,
size_t time,
float w,
float l,
float spd,
float var,
float spr,
float spr2);
66 Particle newParticle(
size_t anim,
size_t time,
float w,
float l,
float spd,
float var,
float spr,
float spr2);
87 void initTile(glm::vec2* tc,
int num);
123 enabled(),
speed(),
variation(),
spread(),
lat(),
gravity(),
lifespan(),
rate(),
areal(),
areaw(),
128 for (
int i = 0; i < 3; ++i) {
129 colors[i] = glm::vec4(0.0f);
139 void setup(
size_t anim,
size_t time);
148 out <<
" <colors>" << v.
colors[0].x <<
" " << v.
colors[0].y <<
" " << v.
colors[0].z <<
"</colors>" <<
150 out <<
" <colors>" << v.
colors[1].x <<
" " << v.
colors[1].y <<
" " << v.
colors[1].z <<
"</colors>" <<
152 out <<
" <colors>" << v.
colors[2].x <<
" " << v.
colors[2].y <<
" " << v.
colors[2].z <<
"</colors>" <<
154 out <<
" <sizes>" << v.
sizes[0] <<
"</sizes>" << std::endl;
155 out <<
" <sizes>" << v.
sizes[1] <<
"</sizes>" << std::endl;
156 out <<
" <sizes>" << v.
sizes[2] <<
"</sizes>" << std::endl;
157 out <<
" <mid>" << v.
mid <<
"</mid>" << std::endl;
158 out <<
" <slowdown>" << v.
slowdown <<
"</slowdown>" << std::endl;
159 out <<
" <rotation>" << v.
rotation <<
"</rotation>" << std::endl;
160 out <<
" <pos>" << v.
pos.x <<
" " << v.
pos.y <<
" " << v.
pos.z <<
"</pos>" << std::endl;
161 out <<
" <texture>" << v.
texture <<
"</texture>" << std::endl;
162 out <<
" <blend>" << v.
blend <<
"</blend>" << std::endl;
163 out <<
" <order>" << v.
order <<
"</order>" << std::endl;
164 out <<
" <ParticleType>" << v.
ParticleType <<
"</ParticleType>" << std::endl;
165 out <<
" <manim>" << v.
manim <<
"</manim>" << std::endl;
166 out <<
" <mtime>" << v.
mtime <<
"</mtime>" << std::endl;
167 out <<
" <rows>" << v.
rows <<
"</rows>" << std::endl;
168 out <<
" <cols>" << v.
cols <<
"</cols>" << std::endl;
169 out <<
" <billboard>" << v.
billboard <<
"</billboard>" << std::endl;
170 out <<
" <rem>" << v.
rem <<
"</rem>" << std::endl;
171 out <<
" <flags>" << v.
flags <<
"</flags>" << std::endl;
172 out <<
" <EmitterType>" << v.
EmitterType <<
"</EmitterType>" << std::endl;
173 out <<
" <tofs>" << v.
tofs <<
"</tofs>" << std::endl;
219 void setup(
size_t anim,
size_t time);
Generic animated value class that reads keyframe data from M2 files.
Represents a single bone in a WoW M2 model skeleton.
Abstract base class representing a file within the game data archive.
Abstract base class for particle emitters.
ParticleSystem * sys
Owning particle system.
virtual ~ParticleEmitter()=default
virtual Particle newParticle(size_t anim, size_t time, float w, float l, float spd, float var, float spr, float spr2)=0
Create a new particle with the given emission parameters.
ParticleEmitter(ParticleSystem *sys)
M2 particle system — manages emission, simulation, and rendering of particles.
ParticleEmitter * emitter
void setup(size_t anim, size_t time)
bool replaceParticleColors
void init(GameFile *f, M2ParticleDef &mta, std::vector< uint32 > &globals)
std::vector< particleColorSet > particleColorReplacements
std::vector< glm::vec4 > particleColorSet
std::vector< TexCoordSet > tiles
void initTile(glm::vec2 *tc, int num)
friend std::ostream & operator<<(std::ostream &out, const ParticleSystem &v)
Animated< float > gravity
Animated< uint16 > enabled
static void useDoNotTrailInfo()
static bool useDoNotTrail
Animated< float > lifespan
Animated< float > variation
Emits particles from a rectangular plane.
Particle newParticle(size_t anim, size_t time, float w, float l, float spd, float var, float spr, float spr2)
Create a new particle with the given emission parameters.
PlaneParticleEmitter(ParticleSystem *sys)
M2 ribbon emitter — produces trailing ribbon effects attached to bones.
Animated< glm::vec3 > color
void setup(size_t anim, size_t time)
std::list< RibbonSegment > segs
void init(GameFile *f, ModelRibbonEmitterDef &mta, std::vector< uint32 > &globals)
Emits particles from the surface of a sphere.
SphereParticleEmitter(ParticleSystem *sys)
Particle newParticle(size_t anim, size_t time, float w, float l, float spd, float var, float spr, float spr2)
Create a new particle with the given emission parameters.
Core WoW .m2 model: geometry, animation, textures, and character data.
std::list< Particle > ParticleList
On-disk particle emitter definition in an M2 file.
A single particle instance in a particle system.
glm::vec3 dir
Position, velocity, gravity, origin, and direction.
glm::vec3 corners[4]
Billboard corner positions.
float maxlife
Current size, remaining life, and maximum lifespan.
size_t tile
Current texture tile index.
glm::vec3 tpos
Transformed position.
glm::vec4 color
Current RGBA colour.
A single segment in a ribbon trail.
float len0
Current length and initial length.
glm::vec3 back
Segment position, up vector, and back vector.
A set of 4 texture coordinates for a particle tile.
glm::vec2 tc[4]
Texture coordinates for the four corners.