[Gcblue-commits] gcb_wx/include/graphics tc3DTerrain.h,1.11,1.12 tcTerrainTextureFactory.h,1.4,1.5
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-07-26 01:44:48
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5274/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.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tc3DTerrain.h 19 Jul 2004 00:52:26 -0000 1.11 --- tc3DTerrain.h 26 Jul 2004 01:44:40 -0000 1.12 *************** *** 1,6 **** /* ! ** tc3DTerrain.h ! ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- /* ! ** @file tc3DTerrain.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 60,76 **** ~tc3DTerrain(); private: ! tcMapData *mapData; ///< pointer to tcMapData object enum { GRID_DIM = 256, ! TEX_CELL_DIM = 8 ///< number of texture cells on side of grid }; float gridSpacing; ///< distance between neighbors in terrain grid [world coord units=m] float gridOffset; ///< offset for x and y for (0,0) grid element float elevationArray[GRID_DIM*GRID_DIM]; ! Uint8 mapTexture[GRID_DIM*GRID_DIM*3]; ///< texture to drape over terrain, RGB bytes osg::ref_ptr<Demeter::Terrain> terrain; ///< Demeter terrain object osg::ref_ptr<osg::Geode> terrainNode; ///< drawable terrain object to place into osg scenegraph ! tcTerrainTextureFactory *texFactory; // these members are the same as in tc3DViewer (copied for simplicity for now) --- 60,78 ---- ~tc3DTerrain(); private: ! tcMapData* mapData; ///< pointer to tcMapData object enum { GRID_DIM = 256, ! TEX_CELL_DIM = 1, ///< number of texture cells on side of grid ! BASE_TEX_DIM = 515 }; float gridSpacing; ///< distance between neighbors in terrain grid [world coord units=m] float gridOffset; ///< offset for x and y for (0,0) grid element float elevationArray[GRID_DIM*GRID_DIM]; ! Demeter::Texture* baseTexture; ///< texture to drape over terrain, RGB bytes ! osg::ref_ptr<Demeter::Terrain> terrain; ///< Demeter terrain object osg::ref_ptr<osg::Geode> terrainNode; ///< drawable terrain object to place into osg scenegraph ! tcTerrainTextureFactory* texFactory; // these members are the same as in tc3DViewer (copied for simplicity for now) Index: tcTerrainTextureFactory.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcTerrainTextureFactory.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcTerrainTextureFactory.h 19 Jul 2004 00:52:26 -0000 1.4 --- tcTerrainTextureFactory.h 26 Jul 2004 01:44:40 -0000 1.5 *************** *** 37,46 **** * 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); --- 37,57 ---- * Class to do procedural texture generation for Demeter terrain * Modify this to use iterator for std::map + * 25JUL DDC - This was reworked to use a single procedural texture. + * There was no way to display terrain without seams with the old + * code derived from Demeter::TextureFactory */ ! class tcTerrainTextureFactory //: public Demeter::TextureFactory { public: void BuildTextures(); ///< rebuilds procedural textures, called when origin changes + static Demeter::Texture* CreateEmptyTexture(int texSize); + + void UpdateCommonTexture(); + void UpdateBaseTexture(Demeter::Texture* texture); + void Update(); ///< called every frame to distribute texture loading over multiple frames + void UpdateTexture(Demeter::Texture* pTexture, float originX, float originY, + float width, float height); + tcTerrainTextureFactory(Demeter::Terrain* pTerrain, tc3DTerrain *tm, int griddimension); *************** *** 68,72 **** bool doGradualUpdate; ///< true to calculate procedural textures over multiple frames - Demeter::Terrain *terrain; tc3DTerrain *terrainManager; --- 79,82 ---- *************** *** 78,81 **** --- 88,93 ---- osg::ref_ptr<osg::Image> grassTexture; osg::ref_ptr<osg::Image> mountainTexture; + osg::ref_ptr<osg::Image> groundDetailTexture; + Demeter::Texture *defaultTexture; Demeter::Texture *defaultTextureLand; // workaround to show land texture for default over land *************** *** 95,100 **** void InitTextureCache(); void LoadTerrainTextures(); ! void UpdateTexture(Demeter::Texture* pTexture, float originX, float originY, ! float width, float height); }; --- 107,111 ---- void InitTextureCache(); void LoadTerrainTextures(); ! }; |