Particle.cpp

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 

Generated on Mon Feb 16 15:14:46 2009 for Scorched3D by  doxygen 1.5.3