Make gen_surface_points accessible through the API.
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user