static int
leaf_in_range_callback (ssgEntity * entity, int mask)
{
- sgLeafUserData * data = (sgLeafUserData *)entity->getUserData();
+ SGLeafUserData * data = (SGLeafUserData *)entity->getUserData();
if (!data->is_filled_in) {
// Iterate through all the triangles
static int
leaf_out_of_range_callback (ssgEntity * entity, int mask)
{
- sgLeafUserData * data = (sgLeafUserData *)entity->getUserData();
+ SGLeafUserData * data = (SGLeafUserData *)entity->getUserData();
if (data->is_filled_in) {
data->branch->removeAllKids();
data->is_filled_in = false;
lod->addKid(in_range);
lod->addKid(out_of_range);
- sgLeafUserData * data = new sgLeafUserData;
+ SGLeafUserData * data = new SGLeafUserData;
data->is_filled_in = false;
data->leaf = leaf;
data->mat = mat;
out_of_range->setTravCallback(SSG_CALLBACK_PRETRAV,
leaf_out_of_range_callback);
out_of_range
- ->addKid(new sgDummyBSphereEntity(leaf->getBSphere()->getRadius()));
+ ->addKid(new SGDummyBSphereEntity(leaf->getBSphere()->getRadius()));
}
*
*/
-void sgTriUserData::fill_in_triangle ()
+void SGTriUserData::fill_in_triangle ()
{
// generate a repeatable random seed
sg_srandom(seed);
}
}
-void sgTriUserData::add_object_to_triangle (SGMatModel * object)
+void SGTriUserData::add_object_to_triangle (SGMatModel * object)
{
// Set up the random heading if required.
double hdg_deg = 0;
branch->addKid(pos);
}
-void sgTriUserData::makeWorldMatrix (sgMat4 mat, double hdg_deg )
+void SGTriUserData::makeWorldMatrix (sgMat4 mat, double hdg_deg )
{
if (hdg_deg == 0) {
mat[0][0] = leafData->sin_lat * leafData->cos_lon;
static int
tri_in_range_callback (ssgEntity * entity, int mask)
{
- sgTriUserData * data = (sgTriUserData *)entity->getUserData();
+ SGTriUserData * data = (SGTriUserData *)entity->getUserData();
if (!data->is_filled_in) {
data->fill_in_triangle();
data->is_filled_in = true;
static int
tri_out_of_range_callback (ssgEntity * entity, int mask)
{
- sgTriUserData * data = (sgTriUserData *)entity->getUserData();
+ SGTriUserData * data = (SGTriUserData *)entity->getUserData();
if (data->is_filled_in) {
data->branch->removeAllKids();
data->is_filled_in = false;
*
*/
-void sgLeafUserData::setup_triangle (int i )
+void SGLeafUserData::setup_triangle (int i )
{
short n1, n2, n3;
leaf->getTriangle(i, &n1, &n2, &n3);
// Set up the user data for if/when
// the random objects in this triangle
// are filled in.
- sgTriUserData * data = new sgTriUserData;
+ SGTriUserData * data = new SGTriUserData;
data->is_filled_in = false;
data->p1 = p1;
data->p2 = p2;
out_of_range->setUserData(data);
out_of_range->setTravCallback(SSG_CALLBACK_PRETRAV,
tri_out_of_range_callback);
- out_of_range->addKid(new sgDummyBSphereEntity(bounding_radius));
+ out_of_range->addKid(new SGDummyBSphereEntity(bounding_radius));
lod->addKid(out_of_range);
}
}
/**
* User data for populating leaves when they come in range.
*/
-class sgLeafUserData : public ssgBase
+class SGLeafUserData : public ssgBase
{
public:
bool is_filled_in;
/**
* User data for populating triangles when they come in range.
*/
-class sgTriUserData : public ssgBase
+class SGTriUserData : public ssgBase
{
public:
bool is_filled_in;
double area;
SGMatModelGroup * object_group;
ssgBranch * branch;
- sgLeafUserData * leafData;
+ SGLeafUserData * leafData;
unsigned int seed;
void fill_in_triangle();
* it works and seems fairly efficient (since branches can still
* be culled when they're out of the view frustum).
*/
-class sgDummyBSphereEntity : public ssgBranch
+class SGDummyBSphereEntity : public ssgBranch
{
public:
- sgDummyBSphereEntity (float radius)
+ SGDummyBSphereEntity (float radius)
{
bsphere.setCenter(0, 0, 0);
bsphere.setRadius(radius);
}
- virtual ~sgDummyBSphereEntity () {}
+ virtual ~SGDummyBSphereEntity () {}
virtual void recalcBSphere () { bsphere_is_invalid = false; }
};