Change cloudfield::addCloud interface,

so it's more obvious that "addCloud" won't keep a reference to SGNewCloud.
This commit is contained in:
ThorstenB
2011-03-07 19:26:37 +01:00
parent a22dd264cd
commit 2ef8672a6b
2 changed files with 8 additions and 4 deletions

View File

@@ -253,10 +253,9 @@ void SGCloudField::applyCoverage(void) {
last_coverage = coverage;
}
void SGCloudField::addCloud( SGVec3f& pos, SGNewCloud *cloud) {
void SGCloudField::addCloud( SGVec3f& pos, osg::ref_ptr<EffectGeode> geode) {
defined3D = true;
osg::ref_ptr<osg::Geode> geode = cloud->genCloud();
// Determine which quadtree to put it in.
int x = (int) floor((pos.x() + fieldSize/2.0) * QUADTREE_SIZE / fieldSize);
if (x >= QUADTREE_SIZE) x = (QUADTREE_SIZE - 1);

View File

@@ -49,6 +49,11 @@ using std::vector;
class SGNewCloud;
namespace simgear
{
class EffectGeode;
}
/**
* A layer of 3D clouds.
*/
@@ -99,7 +104,7 @@ public:
void clear(void);
// add one cloud, data is not copied, ownership given
void addCloud( SGVec3f& pos, SGNewCloud *cloud);
void addCloud( SGVec3f& pos, osg::ref_ptr<simgear::EffectGeode> cloud);
/**
* reposition the cloud layer at the specified origin and