1 // tile.hxx -- routines to handle a scenery tile
3 // Written by Curtis Olson, started May 1998.
5 // Copyright (C) 1998 Curtis L. Olson - curt@infoplane.com
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 // (Log is kept at end of this file)
30 # error This library requires C++
45 extern "C" void *memmove(void *, const void *, size_t);
46 extern "C" void *memset(void *, int, size_t);
49 #include <list> // STL list
50 #ifdef NEEDNAMESPACESTD
54 #include <Bucket/bucketutils.h>
55 #include <Include/fg_types.h>
58 // Object fragment data class
62 // culling data for this object fragment (fine grain culling)
63 fgCartesianPoint3d center;
64 double bounding_radius;
66 // variable offset data for this object fragment for this frame
67 // fgCartesianPoint3d tile_offset;
69 // saved transformation matrix for this fragment (used by renderer)
70 // GLfloat matrix[16];
72 // tile_ptr & material_ptr are set so that when we traverse the
73 // list of fragments we can quickly reference back the tile or
74 // material property this fragment is assigned to.
76 // material property pointer
82 // OpenGL display list for fragment data
98 // culling data for whole tile (course grain culling)
99 fgCartesianPoint3d center;
100 double bounding_radius;
101 fgCartesianPoint3d offset;
102 GLdouble model_view[16];
104 // this tile's official location in the world
105 fgBUCKET tile_bucket;
107 // the tile cache will mark here if the tile is being used
110 list < fgFRAGMENT > fragment_list;
124 // Revision 1.9 1998/07/06 21:34:34 curt
125 // Added using namespace std for compilers that support this.
127 // Revision 1.8 1998/07/04 00:54:30 curt
128 // Added automatic mipmap generation.
130 // When rendering fragments, use saved model view matrix from associated tile
131 // rather than recalculating it with push() translate() pop().
133 // Revision 1.7 1998/06/12 00:58:05 curt
134 // Build only static libraries.
135 // Declare memmove/memset for Sloaris.
137 // Revision 1.6 1998/06/08 17:57:54 curt
138 // Working first pass at material proporty sorting.
140 // Revision 1.5 1998/06/06 01:09:32 curt
141 // I goofed on the log message in the last commit ... now fixed.
143 // Revision 1.4 1998/06/06 01:07:18 curt
144 // Increased per material fragment list size from 100 to 400.
145 // Now correctly draw viewable fragments in per material order.
147 // Revision 1.3 1998/06/05 22:39:54 curt
148 // Working on sorting by, and rendering by material properties.
150 // Revision 1.2 1998/06/03 00:47:50 curt
151 // No .h for STL includes.
152 // Minor view culling optimizations.
154 // Revision 1.1 1998/05/23 14:09:21 curt
155 // Added tile.cxx and tile.hxx.
156 // Working on rewriting the tile management system so a tile is just a list
157 // fragments, and the fragment record contains the display list for that fragment.