[Gcblue-commits] gcb_wx/include/graphics tc3DTerrain.h,1.9,1.10 tcTerrainTextureFactory.h,1.2,1.3
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-05-14 23:37:16
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1674/include/graphics Modified Files: tc3DTerrain.h tcTerrainTextureFactory.h Log Message: Index: tc3DTerrain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DTerrain.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tc3DTerrain.h 11 Apr 2004 21:13:00 -0000 1.9 --- tc3DTerrain.h 14 May 2004 23:37:06 -0000 1.10 *************** *** 54,57 **** --- 54,58 ---- void SetGameTime(double t) {gameTime = t;} void SetOrigin(double lon, double lat); ///< sets origin of 3D world coordinates + void Update(); tc3DTerrain(); *************** *** 81,84 **** --- 82,91 ---- double gameTime; ///< current game time [s] + // variables for gradual update + bool updateScheduled; + bool updating; + int update_i; + bool doGradualUpdate; ///< true to update elevation over multiple frames + float LonToX(double lon); float LatToY(double lat); *************** *** 87,90 **** --- 94,98 ---- void CheckElevations(); void UpdateElevations(); + void UpdateElevationsSlowly(); }; Index: tcTerrainTextureFactory.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcTerrainTextureFactory.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcTerrainTextureFactory.h 11 Apr 2004 21:24:57 -0000 1.2 --- tcTerrainTextureFactory.h 14 May 2004 23:37:06 -0000 1.3 *************** *** 2,6 **** ** tcTerrainTextureFactory.h ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 2,6 ---- ** tcTerrainTextureFactory.h ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 34,45 **** class tc3DTerrain; class tcTerrainTextureFactory : public Demeter::TextureFactory { public: void BuildTextures(); ///< rebuilds procedural textures, called when origin changes tcTerrainTextureFactory(Demeter::Terrain* pTerrain, tc3DTerrain *tm, int griddimension); virtual ~tcTerrainTextureFactory(); ! virtual Demeter::Texture* GetTexture(int index,float originX,float originY,float width,float height); ! virtual void UnloadTexture(int index); private: enum --- 34,51 ---- class tc3DTerrain; + /** + * Class to do procedural texture generation for Demeter terrain + * Modify this to use iterator for std::map + */ class tcTerrainTextureFactory : public Demeter::TextureFactory { public: void BuildTextures(); ///< rebuilds procedural textures, called when origin changes + void Update(); ///< called every frame to distribute texture loading over multiple frames tcTerrainTextureFactory(Demeter::Terrain* pTerrain, tc3DTerrain *tm, int griddimension); + virtual ~tcTerrainTextureFactory(); ! virtual Demeter::Texture* GetTexture(int index,float originX,float originY,float width,float height); ! virtual void UnloadTexture(int index); private: enum *************** *** 48,54 **** --- 54,76 ---- }; int gridDimension; ///< number of texture cells along one dimension of grid + const int edgeDepthLow; ///< distance from edge of grid to use low resolution + const int edgeDepthMed; ///< distance from edge of grid to use med res (if not low res) + const float textureSize; ///< high resolution texture size + const int textureSizeInt; + const float textureSizeMed ; ///< medium resolution texture size + const int textureSizeMedInt; + const float textureSizeLow; ///< low resolution texture size + const int textureSizeLowInt; + bool updateScheduled; + bool updating; + float updateX; + float updateY; + bool doGradualUpdate; ///< true to calculate procedural textures over multiple frames + + Demeter::Terrain *terrain; tc3DTerrain *terrainManager; std::map<int,Demeter::Texture*> m_Textures; + osg::ref_ptr<osg::Image> seaTexture; osg::ref_ptr<osg::Image> coastTexture; *************** *** 67,70 **** --- 89,93 ---- } textureInfo[NUM_TEXTURES]; + Demeter::Texture* CreateEmptyTexture(int nX, int nY); void FreeTextureCache(); int GetTextureIndex(float x, float y); ///< gets index of precalc tex for coord (x,y) |