00001 // leaf.hxx -- function to build and ssg leaf from higher level data. 00002 // 00003 // Written by Curtis Olson, started October 1997. 00004 // 00005 // Copyright (C) 1997 - 2003 Curtis L. Olson - http://www.flightgear.org/~curt 00006 // 00007 // This program is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU General Public License as 00009 // published by the Free Software Foundation; either version 2 of the 00010 // License, or (at your option) any later version. 00011 // 00012 // This program is distributed in the hope that it will be useful, but 00013 // WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with this program; if not, write to the Free Software 00019 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 // 00021 // $Id: leaf_8hxx-source.html,v 1.12 2007-12-17 15:37:05 curt Exp $ 00022 00023 00024 #ifndef _SG_LEAF_HXX 00025 #define _SG_LEAF_HXX 00026 00027 00028 #ifndef __cplusplus 00029 # error This library requires C++ 00030 #endif 00031 00032 00033 #include <simgear/compiler.h> 00034 00035 #include STL_STRING 00036 00037 #include <plib/ssg.h> // plib include 00038 00039 #include <simgear/math/sg_types.hxx> 00040 00041 SG_USING_STD(string); 00042 00043 00044 class SGMaterialLib; // forward declaration. 00045 00046 00047 // Create a ssg leaf 00048 ssgLeaf *sgMakeLeaf( const string& path, 00049 const GLenum ty, 00050 SGMaterialLib *matlib, const string& material, 00051 const point_list& nodes, const point_list& normals, 00052 const point_list& texcoords, 00053 const int_list& node_index, 00054 const int_list& normal_index, 00055 const int_list& tex_index, 00056 const bool calc_lights, ssgVertexArray *lights ); 00057 00058 00059 // return a newly created list of points randomly spread across the 00060 // specified leaf. "factor" specifies density ... on average there 00061 // will be one object per the area specified by "factor" in m^2 A 00062 // larger factor will mean fewer objects. 00063 ssgVertexArray *sgGenRandomSurfacePoints( ssgLeaf *leaf, double factor ); 00064 00065 // Another varient of the same routine. 00066 void sgGenRandomSurfacePoints( ssgLeaf *leaf, double factor, 00067 ssgVertexArray *lights ); 00068 00069 #endif // _SG_LEAF_HXX
1.5.1