# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

particle_system_instance_user.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2000, 2001 Nevrax Ltd.
00008  *
00009  * This file is part of NEVRAX NEL.
00010  * NEVRAX NEL is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * NEVRAX NEL is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details.
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
00024  */
00025 
00026 #ifndef NL_PARTICLE_SYSTEM_INSTANCE_USER_H
00027 #define NL_PARTICLE_SYSTEM_INSTANCE_USER_H
00028 
00029 #include "nel/misc/types_nl.h"
00030 #include "nel/3d/u_particle_system_instance.h"
00031 #include "3d/particle_system_model.h"
00032 #include "3d/transform_user.h"
00033 
00034 #include <vector>
00035 
00036 
00037 namespace NL3D {
00038 
00039 
00046 class CParticleSystemInstanceUser : virtual public UParticleSystemInstance
00047                                                                   , virtual public CTransformUser
00048                                                                   , public CParticleSystemModel::IPSModelObserver
00049 {
00050 public: 
00051         // \name Object
00052         // @{           
00053                 CParticleSystemInstanceUser(CScene *scene, IModel *model);
00054                 ~CParticleSystemInstanceUser();
00055         // @}
00056 
00057 
00058         // \name inherited from uinstance
00059         // @{                                           
00060                 virtual uint                            getNumMaterials() const;        
00061                 virtual UInstanceMaterial       &getMaterial(uint materialId);
00062                 virtual void selectTextureSet(uint id) { nlassert(0); /* not supported for particle systems */ }
00063                 virtual void                            getShapeAABBox(NLMISC::CAABBox &bbox) const;
00064         // @}
00065 
00066         // \name inherited from UParticleSystemInstance
00067         // @{
00068                 virtual void            emit(uint32 id, uint quantity);
00069                 virtual void            removeByID(uint32 id);
00070                 virtual bool            isSystemPresent         (void) const;           
00071                 virtual bool            getSystemBBox(NLMISC::CAABBox &bbox);
00072                 virtual void            setUserParam            (uint index, float value);
00073                 virtual float           getUserParam            (uint index) const;
00074                 virtual bool            isValid                         (void) const;
00075                 virtual void            registerPSObserver      (IPSObserver *observer);
00076                 virtual bool            isPSObserver            (IPSObserver *observer);
00077                 virtual void            removePSObserver        (IPSObserver *observer);
00078         // @}
00079 
00080         // \name inherited from  CParticleSystemModel::IPSModelObserver
00081         // @{
00082                 virtual void invalidPS(CParticleSystemModel *psm); 
00083         // @}
00084 
00085         // No-op for ParticleSystem
00086         virtual void            changeMRMDistanceSetup(float distanceFinest, float distanceMiddle, float distanceCoarsest);
00087         // change/get Shape distMax.
00088         virtual void            setShapeDistMax(float distMax);
00089         virtual float           getShapeDistMax() const;
00090 
00091 private:
00093         std::vector<IPSObserver *> _Observers;
00095         bool _Invalidated;
00096 
00097 };
00098 
00099 
00100 } // NL3D
00101 
00102 
00103 #endif // NL_PARTICLE_SYSTEM_INSTANCE_USER_H
00104 
00105 /* End of particle_system_instance_user.h */