[Plib-cvs] plib/src/ssgAux ssgaLensFlare.cxx,NONE,1.1 ssgaLensFlare.h,NONE,1.1 ssgaLensFlareTexture.
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2002-08-24 16:56:56
|
Update of /cvsroot/plib/plib/src/ssgAux In directory usw-pr-cvs1:/tmp/cvs-serv2755/plib/src/ssgAux Modified Files: Makefile.am ssgAux.h Added Files: ssgaLensFlare.cxx ssgaLensFlare.h ssgaLensFlareTexture.cxx Log Message: Added Lens Flare to ssgAux. --- NEW FILE: ssgaLensFlare.cxx --- #include "ssgAux.h" #undef _SSG_PUBLIC #include "../ssg/ssgLocal.h" /* Lens flares are an effect that happens in the lens - your eye or a camera lens. As such, they are completely invisible if the light itself is not visible - which should mean that if the light is culled then so is the lens flare. This suggests that the bsphere center should be at the light point and the radius should be tiny. However, if you have a multi-facetted display, pretending to be a single display rather than a lot of separate 'cameras' then you may want to set the SSGA_CONTINUOUS_DISPLAY_SURFACE flag. [...276 lines suppressed...] /* Lens flares are best generated in eye-space (because they actually occur inside the lens of your eye). Hence we call 'update' with the current modelview matrix - it generates the geometry in eye-space - which means that we have to render it with the identity matrix on the stack. */ update ( m ) ; _ssgPushMatrix ( _ssgaIdentity ) ; glPushMatrix () ; glLoadMatrixf ( (float *) _ssgaIdentity ) ; ssgBranch::cull ( f, _ssgaIdentity, FALSE ) ; glPopMatrix () ; _ssgPopMatrix () ; } --- NEW FILE: ssgaLensFlare.h --- #include "ssgaShapes.h" class ssgaLensFlare : public ssgaShape { ssgVtxTable *vt ; ssgVertexArray *v0 ; ssgNormalArray *n0 ; ssgColourArray *c0 ; ssgTexCoordArray *t0 ; void update ( sgMat4 m ) ; protected: virtual void copy_from ( ssgaLensFlare *src, int clone_flags ) ; public: ssgaLensFlare () ; ssgaLensFlare ( int nt ) ; virtual ~ssgaLensFlare () ; virtual ssgBase *clone ( int clone_flags = 0 ) ; virtual void regenerate () ; virtual const char *getTypeName ( void ) ; virtual void cull ( sgFrustum *f, sg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 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ; unsigned char *_ssgaGetLensFlareTexture () { return lens_flare_texture ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.am 4 Aug 2002 05:53:44 -0000 1.8 +++ Makefile.am 24 Aug 2002 16:56:53 -0000 1.9 @@ -1,13 +1,15 @@ lib_LIBRARIES = libplibssgaux.a -include_HEADERS = ssgAux.h ssgaShapes.h ssgaParticleSystem.h ssgaWaveSystem.h +include_HEADERS = ssgAux.h ssgaShapes.h ssgaLensFlare.h ssgaParticleSystem.h ssgaWaveSystem.h libplibssgaux_a_SOURCES = ssgAux.cxx \ ssgaShapes.cxx \ ssgaPatch.cxx \ ssgaParticleSystem.cxx \ ssgaWaveSystem.cxx \ + ssgaLensFlare.cxx \ + ssgaLensFlareTexture.cxx \ ssgaTeapot.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/ssg Index: ssgAux.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgAux.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgAux.h 4 Aug 2002 05:53:44 -0000 1.11 +++ ssgAux.h 24 Aug 2002 16:56:53 -0000 1.12 @@ -30,6 +30,7 @@ #include "ssgaShapes.h" #include "ssgaParticleSystem.h" #include "ssgaWaveSystem.h" +#include "ssgaLensFlare.h" #define _SSGA_TYPE_SHAPE 0x00008000 @@ -40,6 +41,7 @@ #define _SSGA_TYPE_TEAPOT 0x00020000 #define _SSGA_TYPE_PARTICLESYSTEM 0x00040000 #define _SSGA_TYPE_WAVESYSTEM 0x00080000 +#define _SSGA_TYPE_LENSFLARE 0x00100000 inline int ssgaTypeShape () { return _SSGA_TYPE_SHAPE | ssgTypeBranch ();} inline int ssgaTypeCube () { return _SSGA_TYPE_CUBE | ssgaTypeShape ();} @@ -51,6 +53,8 @@ { return _SSGA_TYPE_PARTICLESYSTEM | ssgaTypeShape ();} inline int ssgaTypeWaveSystem () { return _SSGA_TYPE_WAVESYSTEM | ssgaTypeShape ();} +inline int ssgaTypeLensFlare () + { return _SSGA_TYPE_LENSFLARE | ssgaTypeShape ();} void ssgaInit () ; |