}
}
-void CloudShaderGeometry::addSprite(SGVec3f& p, int tx, int ty,
+void CloudShaderGeometry::addSprite(const SGVec3f& p, int tx, int ty,
float w, float h,
float s, float cull, float cloud_height)
{
META_Object(flightgear, CloudShaderGeometry);
struct CloudSprite {
- CloudSprite(SGVec3f& p, int tx, int ty, float w, float h, float s, float ch) :
+ CloudSprite(const SGVec3f& p, int tx, int ty, float w, float h,
+ float s, float ch) :
position(p), texture_index_x(tx), texture_index_y(ty), width(w), height(h), shade(s), cloud_height(ch)
{ }
_geometry = geometry;
}
- void addSprite(SGVec3f& p, int tx, int ty, float w, float h, float s, float cull, float cloud_height);
+ void addSprite(const SGVec3f& p, int tx, int ty, float w, float h,
+ float s, float cull, float cloud_height);
osg::ref_ptr<osg::Drawable> _geometry;
z = height * cos(elev) * 0.5f;
}
- SGVec3f *pos = new SGVec3f(x, y, z);
-
// Determine the height and width as scaling factors on the minimum size (used to create the quad)
float sprite_width = 1.0f + sg_random() * (max_sprite_width - min_sprite_width) / min_sprite_width;
float sprite_height = 1.0f + sg_random() * (max_sprite_height - min_sprite_height) / min_sprite_height;
int index_y = (int) floor(sg_random() * num_textures_y);
if (index_y == num_textures_y) { index_y--; }
- sg->addSprite(*pos,
+ sg->addSprite(SGVec3f(x, y, z),
index_x,
index_y,
sprite_width,