Make gen_surface_points accessible through the API.

This commit is contained in:
curt
2003-05-28 19:02:43 +00:00
parent 94c22fec46
commit 8b8a82bb67
2 changed files with 21 additions and 3 deletions

View File

@@ -66,8 +66,9 @@ static void random_pt_inside_tri( float *res,
}
static void gen_random_surface_points( ssgLeaf *leaf, ssgVertexArray *lights,
double factor ) {
void sgGenRandomSurfacePoints( ssgLeaf *leaf, double factor,
ssgVertexArray *lights )
{
int tris = leaf->getNumTriangles();
if ( tris > 0 ) {
short int n1, n2, n3;
@@ -108,6 +109,13 @@ static void gen_random_surface_points( ssgLeaf *leaf, ssgVertexArray *lights,
}
ssgVertexArray *sgGenRandomSurfacePoints( ssgLeaf *leaf, double factor ) {
ssgVertexArray *result = new ssgVertexArray();
sgGenRandomSurfacePoints( leaf, factor, result );
return result;
}
////////////////////////////////////////////////////////////////////////
// Scenery loaders.
@@ -251,7 +259,7 @@ ssgLeaf *sgMakeLeaf( const string& path,
<< coverage << ", pushing up to 10000");
coverage = 10000;
}
gen_random_surface_points(leaf, lights, coverage);
sgGenRandomSurfacePoints(leaf, coverage, lights );
}
}

View File

@@ -56,4 +56,14 @@ ssgLeaf *sgMakeLeaf( const string& path,
const bool calc_lights, ssgVertexArray *lights );
// return a newly created list of points randomly spread across the
// specified leaf. "factor" specifies density ... on average there
// will be one object per the area specified by "factor" in m^2 A
// larger factor will mean fewer objects.
ssgVertexArray *sgGenRandomSurfacePoints( ssgLeaf *leaf, double factor );
// Another varient of the same routine.
void sgGenRandomSurfacePoints( ssgLeaf *leaf, double factor,
ssgVertexArray *lights );
#endif // _SG_LEAF_HXX