00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <graph/Particle.h>
00022
00023 Particle::Particle() :
00024 life_(-1.0f), renderer_(0), userData_(0),
00025 distance_(0.0f), texture_(0), shadow_(false),
00026 textureCoord_(0), simulated_(false),
00027 windAffect_(true), textureSet_(0),
00028 engine_(0)
00029 {
00030 }
00031
00032 Particle::~Particle()
00033 {
00034 }
00035
00036 void Particle::setParticle(
00037 float life, float mass, float friction,
00038 Vector &velocity, Vector &gravity,
00039 Vector &color, Vector &colorCounter,
00040 Vector &size, Vector &sizeCounter,
00041 float alpha, float alphaCounter,
00042 bool additiveTexture,
00043 bool windAffect)
00044 {
00045 life_ = life; mass_ = mass; friction_ = friction;
00046 percent_ = 0.0f; percentCounter_ = 1.0f / life_;
00047 velocity_ = velocity; gravity_ = gravity;
00048 color_ = color; colorCounter_ = colorCounter;
00049 size_ = size; sizeCounter_ = sizeCounter;
00050 alpha_ = alpha; alphaCounter_ = alphaCounter;
00051 additiveTexture_ = additiveTexture;
00052 windAffect_ = windAffect;
00053 }
00054
00055 void Particle::unsetParticle()
00056 {
00057 delete userData_;
00058 userData_ = 0;
00059 texture_ = 0;
00060 textureSet_ = 0;
00061 shadow_ = false;
00062 simulated_ = false;
00063 }
00064