VedaLib3DEngine/ParticleSetVirtual.h

Go to the documentation of this file.
00001 /*! \file 
00002     \author victorien ferry & www.m4nkind.com
00003     \brief This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING.
00004 */
00005 #ifndef COM_M4NKIND_ParticleSetVirtual_H
00006 #define COM_M4NKIND_ParticleSetVirtual_H
00007 
00008 #include "BaseObject.h"
00009 #include "PackLong_WithLimits.h"
00010 /*!
00011     \class  ParticleSetVirtual
00012     \ingroup BaseObjectInherited_VedaLib3DEngine
00013     \brief  virtual Class defining a generic Particle set.
00014 */
00015 class ParticleSetVirtual : public BaseObject
00016 {
00017 /*==================================================================
00018                                 PUBLIC
00019 ==================================================================*/
00020 public:
00021     /*!
00022         \brief  Constructor. There should only be members initialisation there.
00023     */
00024     ParticleSetVirtual(void);
00025 
00026     /*!
00027         \brief  Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp
00028     */
00029     BASEOBJECT_DEFINE_VIRTUALCLASS(ParticleSetVirtual);
00030     /*!
00031         \class  Particle
00032         \brief  
00033     */
00034     class Particle
00035     {   public:
00036         float   m_xyzd[4];
00037     };
00038 
00039     /*!
00040         \brief  get a particle in its current state.
00041         \param  _index  the particle index in the population.
00042     */
00043     virtual void    SetFrameDate( float _frameDate )=0;
00044 
00045     /*!
00046         \brief  get current number of particle you can get with Get()
00047         \return current max.
00048     */
00049     inline unsigned int GetNumberOfParticle(){ return m_NumberOfActiveParticle; };
00050 
00051     /*!
00052         \brief  get a particle in its current state.
00053         \param  _index  the particle index in the population.
00054     */
00055     inline Particle *Get( int _index ){ return &(m_pCurrentParticleSet[_index]); };
00056 
00057 /*==================================================================
00058                                 PROTECTED
00059 ==================================================================*/
00060 protected:
00061 
00062     //! current number of Particle.
00063     PackLong_WithLimits     mSer_MaxNumberOfParticle;
00064 
00065     //! number of active part.
00066     unsigned int            m_NumberOfActiveParticle;
00067     //! optimization....
00068     float                   m_OneOverNumberOfActiveParticle;
00069 
00070     //! last frame date computed.
00071     float                   m_LastFrameDate;
00072 
00073     //! a particle set that can be accessed.
00074     Particle                *m_pCurrentParticleSet;
00075 
00076     /*!
00077         \brief  Method that really build the object using the serializable parameters.
00078                 Close() should close everything opened by CreateInternal().
00079     */
00080     virtual bool CreateInternal(void);
00081 
00082 #ifdef _ENGINE_EDITABLE_
00083     /*!
00084         \brief  that closes everything. Still, the object exist and can be rebuild the same using Create()
00085     */
00086     virtual void    CloseInternal(void);
00087 #endif
00088 
00089 };
00090 
00091 #endif

      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/