# 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  

ps_face_look_at.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 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_PS_FACE_LOOK_AT_H
00027 #define NL_PS_FACE_LOOK_AT_H
00028 
00029 #include "3d/ps_particle_basic.h"
00030 #include "3d/ps_quad.h"
00031 #include "3d/ps_iterator.h"
00032 
00033 namespace NL3D 
00034 {
00035 
00036 
00037 class CPSFaceLookAt;
00038 
00039 
00046 class CPSFaceLookAt :   public CPSQuad
00047                                           , public CPSRotated2DParticle
00048                                         
00049 {
00050 public:
00054         CPSFaceLookAt(CSmartPtr<ITexture> tex = NULL);
00055         
00056         void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
00057         
00058         NLMISC_DECLARE_CLASS(CPSFaceLookAt);
00059                         
00066         void activateMotionBlur(float coeff = 1.f, float threshold = 1.f)
00067         {
00068                 _MotionBlurCoeff = coeff;
00069                 _Threshold = threshold;
00070         }
00071 
00073         void setMotionBlurCoeff(float coeff) { _MotionBlurCoeff = coeff; }
00074 
00076         void setMotionBlurThreshold(float threshold) { _Threshold = threshold; }
00077 
00078 
00079 
00083         float getMotionBlurCoeff(void) const { return _MotionBlurCoeff; }
00084 
00086         float getMotionBlurThreshold(void) const { return _Threshold; }
00087 
00092         void setIndependantSizes(bool enable  = true) { _IndependantSizes = enable; }
00093 
00095         bool hasIndependantSizes(void) const { return _IndependantSizes; }
00096 
00098         CPSSizedParticle &getSecondSize(void) 
00099         { 
00100                 nlassert(_IndependantSizes);
00101                 return _SecondSize;
00102         }
00103 
00105         const CPSSizedParticle &getSecondSize(void) const
00106         { 
00107                 nlassert(_IndependantSizes);
00108                 return _SecondSize;
00109         }
00110         
00111 protected:
00112         friend class                    CPSFaceLookAtHelper;    
00113         float                                   _MotionBlurCoeff;       
00114         float                                   _Threshold; // motion blur theshold
00115         // in this struct we defines the getSizeOwner method, which is abstract in the CPSSizedParticle clas
00116         struct                                  CSecondSize : public CPSSizedParticle
00117         {
00118                 CPSFaceLookAt *Owner;
00119                 virtual CPSLocated *getSizeOwner(void) { return Owner->getOwner(); }
00120         } _SecondSize;
00121         bool                                    _IndependantSizes;              
00122         virtual void                    draw(bool opaque);
00123         void                                    newElement(CPSLocated *emitterLocated, uint32 emitterIndex);    
00124         void                                    deleteElement(uint32);
00125         void                                    resize(uint32);
00126         virtual CPSLocated              *getAngle2DOwner(void) { return _Owner; }
00127 
00128 };
00129 
00130 
00131 } // NL3D
00132 
00133 #endif // NL_PS_FACE_LOOK_AT_H
00134 
00135 /* End of ps_face_look_at.h */