source: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdHeightmapTerrainPageSource.h @ 1273

Revision 1273, 2.9 KB checked in by szydlowski, 18 years ago (diff)

Added the KdTerrainSceneManager?, a subclass of the KdTreeSceneManager? capable of rendering terrain like the TerrainSceneManager? from Ogre.
All the *Kd*Terrain* classes are identical to their octree counterparts, save prefixing all classes and structures with Kd to avoid namespace clashes.
This was necessary, since the TerrainSceneManager? was hard coded in these classes, and all references had to be replaced with the KdTerrainSceneManager?.
Also added a comprehensive README for the demo application.

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#ifndef __KdHeightmapTerrainPageSource_H__
26#define __KdHeightmapTerrainPageSource_H__
27
28#include "OgreKdTerrainPrerequisites.h"
29#include "OgreKdTerrainPageSource.h"
30#include "OgreImage.h"
31
32namespace Ogre {
33
34    /** Specialisation of the TerrainPageSource class to provide tiles loaded
35        from a 2D greyscale image.
36    @remarks
37        This is a simple tile provider that does not support paging; it is
38        assumed that the entire heightmap is loaded as one page.
39    */
40    class _OgreKdTerrainExport KdHeightmapTerrainPageSource : public KdTerrainPageSource
41    {
42    protected:
43        /// Is this input RAW?
44        bool mIsRaw;
45        /// Should we flip terrain vertically?
46        bool mFlipTerrain;
47        /// Image containing the source heightmap if loaded from non-RAW
48        Image mImage;
49        /// Arbitrary data loaded from RAW
50        MemoryDataStreamPtr mRawData;
51        /// The (single) terrain page this source will provide
52        KdTerrainPage* mPage;
53        /// Source file name
54        String mSource;
55        /// Manual size if source is RAW
56        uint mRawSize;
57        /// Manual bpp if source is RAW
58        uchar mRawBpp;
59       
60        /// Load a heightmap
61        void loadHeightmap(void);
62    public:
63        KdHeightmapTerrainPageSource();
64        ~KdHeightmapTerrainPageSource();
65        /// @see TerrainPageSource
66        void shutdown(void);
67        /// @see TerrainPageSource
68        void requestPage(ushort x, ushort y);
69        /// @see TerrainPageSource
70        void expirePage(ushort x, ushort y);
71        /// @see TerrainPageSource
72        void initialise(KdTerrainSceneManager* tsm,
73            uint tileSize, uint pageSize, bool asyncLoading,
74            KdTerrainPageSourceOptionList& optionList);
75    };
76}
77
78#endif
Note: See TracBrowser for help on using the repository browser.