Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

cybwaterc.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2002  Malte Weiß, Carsten Winkelholz
00003 
00004 Malte Weiß, 20.08.2002: Native node developed.
00005             21.08.2002: Field 'waveFocus' added.
00006             22.08.2002: Field 'culling' added.
00007                         Line intersection tests added.
00008             25.08.2002: Bounding-sphere regarded.
00009 
00010 Address:  FGAN Forschungsgesellschaft fr Angewandte Naturwissenschaften e. V.
00011       Neuenahrer Str. 20
00012       D - 53343 Wachtberg
00013       
00014 Email:    winkelholz@fgan.de
00015 
00016 This program is free software; you can redistribute it and/or
00017 modify it under the terms of the GNU General Public License
00018 as published by the Free Software Foundation; either version 2
00019 of the License, or (at your option) any later version.
00020 
00021 This program is distributed in the hope that it will be useful,
00022 but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 GNU General Public License for more details.
00025 
00026 You should have received a copy of the GNU General Public License
00027 along with this program; if not, write to the Free Software
00028 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00029 */
00030 
00031 #ifndef CYBWATER_HC
00032 #define CYBWATER_HC
00033 
00034 #include "oaw/ctk/cybgeometryc.h"
00035 #include "oaw/ctk/cybwrlfields.h"
00036 #include "oaw/ctk/cybtexturemanagerc.h"
00037 #include "oaw/ctk/vertexc.h"
00038 #include "../oawconfig.h"
00039 
00040 OAW_BEGIN_NAMESPACE
00041 
00042 
00043 class CybIsectLineChannelC;
00044 
00045 // Class definition
00046   
00047 class OAW_DLLMAPPING CybWaterC : public CybGeometryC
00048 {
00049 public:
00050   CybWaterC(CybWorldC*);
00051   CybWaterC(const CybWaterC&);
00052   CybWaterC& operator = (const CybWaterC&);
00053   virtual void CreateNewCopy(CybGeometryC* pNode);
00054   virtual ~CybWaterC();
00055 
00056   virtual void FinishInit();
00057   virtual void SetEvent(long, const void*, BaseI*);
00058   virtual long GetFieldEventID(const char*);
00059   virtual long GetFieldDataType(long);
00060 
00061   virtual void ToChannelDefault(CybChannelC*, long lFlag);
00062   virtual void ToChannelTexture(CybChannelC*, long lFlag);
00063   virtual void ToIsectLineChannel(CybIsectLineChannelC*);
00064 
00065 protected:
00066   void         SendIsBoundOutEvents(SFBool b);
00067   virtual void LoadVRML(char*& iter, const char* iterEnd,long& znr);
00068   
00069 protected:
00070   virtual void CleanupRender() {}
00071   virtual void PrepareRender();
00072 
00073   void UpdateWaves();
00074   void TriToIsectLineChannel(CybIsectLineChannelC* pIsectChan, VectorC &vStartLine, VectorC &vEndLine, StandardVertex &v0, StandardVertex &v1, StandardVertex &v2);
00075 
00076 public:
00077   // Water properties
00078   SFBool    m_bEnabled;          // Enabled
00079   SFFloat   m_fXDimension;       // Dimension
00080   SFFloat   m_fZDimension;
00081   SFFloat   m_fXSpacing;         // Spacing
00082   SFFloat   m_fZSpacing;
00083   SFVec3f   m_vCenter;           // Center of wave creation
00084   SFBool    m_bWaveFocus;        // Have waves a point source?
00085   SFFloat   m_fWaveLength;       // Wave length
00086   SFFloat   m_fWaveAmplitude;    // Wave amplitude
00087   SFFloat   m_fWaveAttenuation;  // Wave attenuation
00088   TimeC     m_tCycleInterval;    // Time for one wave cycle
00089   SFVec2f   m_vTextureFactor;    // Texture factor
00090   SFBool    m_bReverse;          // Reverse water movement
00091   SFBool    m_bCulling;          // Culling enabled?
00092 
00093   SFBool    m_bUpdateRender;     // Must render data be updated?
00094 
00095   // Water texture
00096   TEXTURE   m_pTexture;
00097 
00098   // Key list
00099   static char VRMLKeyStrList[][30];
00100 
00101 protected:
00102   // GEOMETRY
00103 
00104   // Water box
00105   StandardVertex *m_pVertices;
00106   unsigned int   *m_pIndices;
00107 
00108   // Counts
00109   long            m_lNumVertices, m_lNumIndices;
00110   long            m_lWidth, m_lHeight;
00111 };
00112 
00113 OAW_END_NAMESPACE
00114 
00115 
00116 #endif

Generated on Tue Jul 29 14:24:14 2003 for Open ActiveWrl by doxygen1.3-rc2