00001 /********************************************************************* 00002 * lescegra * 00003 * * 00004 * http://geeky.kicks-ass.org/projects/lescegra.html * 00005 * * 00006 * Copyright 2003 by Enno Cramer <uebergeek@web.de> * 00007 * * 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Library General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Library General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Library General Public * 00019 * License along with this library; if not, write to the Free * 00020 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00021 *********************************************************************/ 00022 00023 #ifndef LSG_PARTICLESYSTEM_H 00024 #define LSG_PARTICLESYSTEM_H 1 00025 00026 /** 00027 * \file particlesystem.h 00028 * \brief Particle system container 00029 */ 00030 00031 #include <lescegra/sg/group.h> 00032 00033 #include <lescegra/particle/particle.h> 00034 00035 #include <lescegra/util/list.h> 00036 00037 /** 00038 * \ingroup particle 00039 * \brief Particle system container 00040 * 00041 * LsgGroup node to encapsulate all particles and modifiers that belong to one 00042 * particle system. 00043 */ 00044 typedef struct { 00045 LsgGroup super; 00046 LsgList* modifiers; 00047 } LsgParticleSystem; 00048 00049 /** 00050 * Allocate and initialize a new LsgParticleSystem instance. 00051 */ 00052 LsgParticleSystem* LsgParticleSystem_create(void); 00053 00054 /** 00055 * Constructor for LsgParticleSystem. Create an initially empty particle system. 00056 * @param self The instance variable 00057 */ 00058 void LsgParticleSystem_init(LsgParticleSystem* self); 00059 00060 /** 00061 * Update the particle system by updating all containd particles and running all 00062 * modifiers update methods. 00063 * @param self The instance variable 00064 * @param now The current time 00065 */ 00066 void LsgParticleSystem_update(LsgParticleSystem* self, float now); 00067 00068 /** 00069 * Destroy the particle system. 00070 * @param self The instance variable 00071 */ 00072 void LsgParticleSystem_destroy(LsgParticleSystem* self); 00073 00074 /** 00075 * Display the particle system. Reuse parent implementation. 00076 */ 00077 #define LsgParticleSystem_display(self) LsgGroup_display(&(self)->super) 00078 00079 /** 00080 * Clean the particle system. Reuse parant implementation. 00081 */ 00082 #define LsgParticleSystem_clean(self) LsgGroup_clean(&(self)->super) 00083 00084 #endif