sequence.h

00001 /*--License:
00002         Lilith 3D Engine
00003         Copyright Lee Thomason (Grinning Lizard Software) 2002-2007
00004         www.grinninglizard.com/lilith
00005 
00006         This program is free software; you can redistribute it and/or
00007         modify it under the terms of the GNU General Public License
00008         as published by the Free Software Foundation; either version 2
00009         of the License, or (at your option) any later version.
00010 
00011         This program is distributed in the hope that it will be useful,
00012         but WITHOUT ANY WARRANTY; without even the implied warranty of
00013         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014         GNU General Public License for more details.
00015 
00016         You should have received a copy of the GNU General Public License
00017         along with this program; if not, write to the Free Software
00018         Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019 
00020         The full text of the license can be found in license.txt
00021 */
00022 
00023 #ifndef LILITH_SEQUENCE_INCLUDED
00024 #define LILITH_SEQUENCE_INCLUDED
00025 
00026 #include "../grinliz/glpublisher.h"
00027 #include "../grinliz/glvector.h"
00028 #include "../grinliz/glcolor.h"
00029 #include "genericobject.h"
00030 
00031 
00032 namespace lilith3d
00033 {
00034 class TimeClock;
00035 class BlasterSequence;
00036 class SolidMesh;
00037 struct Shader;
00038 
00049 class ISequence
00050 {
00051   public:
00052     virtual ~ISequence()        {}
00053         virtual bool DoSequence( TimeClock* timeClock ) = 0;
00054 };
00055 
00056 
00058 class BlasterListener : public grinliz::Listener< BlasterListener >
00059 {
00060   public:
00064         virtual bool BlasterHit( BlasterSequence* blaster, const LilithObject& hit ) = 0;
00065 };
00066 
00067 
00069 class BlasterSequence : public ISequence
00070 {
00071   public:
00079         BlasterSequence(        const grinliz::Vector3F& origin,
00080                                                 const grinliz::Vector3F& dir,
00081                                                 float speed,
00082                                                 const Mesh* mesh );
00083 
00084         virtual ~BlasterSequence();
00085 
00087         void SetColor( const grinliz::Color3F& color );
00088 
00090         grinliz::Publisher< BlasterListener > publish;
00091 
00092         virtual bool DoSequence( TimeClock* timeClock );
00093 
00094   private:
00095         void Impact( const LilithObject& object );
00096 
00097         grinliz::Vector3F origin;
00098         grinliz::Vector3F pos;
00099         grinliz::Vector3F dir;
00100         float speed;
00101         grinliz::Color4F color;
00102         SolidMesh* solidMesh;
00103         U32 startTime;
00104         int meshId;
00105         bool beamMoving;
00106         const Shader* shader;
00107 };
00108 
00109 
00110 };      // namespace lilith3d
00111 #endif

Generated on Fri Mar 23 19:36:22 2007 for Lilith3D by  doxygen 1.5.1-p1