00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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
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
00078 SFBool m_bEnabled;
00079 SFFloat m_fXDimension;
00080 SFFloat m_fZDimension;
00081 SFFloat m_fXSpacing;
00082 SFFloat m_fZSpacing;
00083 SFVec3f m_vCenter;
00084 SFBool m_bWaveFocus;
00085 SFFloat m_fWaveLength;
00086 SFFloat m_fWaveAmplitude;
00087 SFFloat m_fWaveAttenuation;
00088 TimeC m_tCycleInterval;
00089 SFVec2f m_vTextureFactor;
00090 SFBool m_bReverse;
00091 SFBool m_bCulling;
00092
00093 SFBool m_bUpdateRender;
00094
00095
00096 TEXTURE m_pTexture;
00097
00098
00099 static char VRMLKeyStrList[][30];
00100
00101 protected:
00102
00103
00104
00105 StandardVertex *m_pVertices;
00106 unsigned int *m_pIndices;
00107
00108
00109 long m_lNumVertices, m_lNumIndices;
00110 long m_lWidth, m_lHeight;
00111 };
00112
00113 OAW_END_NAMESPACE
00114
00115
00116 #endif