1 // userdata.hxx -- two classes for populating ssg user data slots in association
2 // with our implimenation of random surface objects.
4 // Written by David Megginson, started December 2001.
6 // Copyright (C) 2001 - 2003 Curtis L. Olson - curt@flightgear.org
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 class SGMatModelGroup;
33 * User data for populating leaves when they come in range.
35 class LeafUserData : public ssgBase
47 void setup_triangle( int i );
52 * User data for populating triangles when they come in range.
54 class TriUserData : public ssgBase
63 SGMatModelGroup * object_group;
65 LeafUserData * leafData;
68 void fill_in_triangle();
69 void add_object_to_triangle(SGMatModel * object);
70 void makeWorldMatrix (sgMat4 ROT, double hdg_deg );
75 * ssgEntity with a dummy bounding sphere, to fool culling.
77 * This forces the in-range and out-of-range branches to be visited
78 * when appropriate, even if they have no children. It's ugly, but
79 * it works and seems fairly efficient (since branches can still
80 * be culled when they're out of the view frustum).
82 class DummyBSphereEntity : public ssgBranch
85 DummyBSphereEntity (float radius)
87 bsphere.setCenter(0, 0, 0);
88 bsphere.setRadius(radius);
90 virtual ~DummyBSphereEntity () {}
91 virtual void recalcBSphere () { bsphere_is_invalid = false; }