Plant::Plant():
- offset(0,0),
+ origin(0,0),
split_angle(Angle::deg(10)),
gravity(0,-0.1),
velocity(0.3),
if((((i+1)*sprouts + steps/2) / steps) > branch_count) {
Vector branch_velocity(deriv(f).norm()*velocity + deriv(f).perp().norm()*perp_velocity);
+ if (isnan(branch_velocity[0]) || isnan(branch_velocity[1]))
+ continue;
+
branch_velocity[0] += random_factor * random(Random::SMOOTH_COSINE, 1, f*splits, 0.0f, 0.0f);
branch_velocity[1] += random_factor * random(Random::SMOOTH_COSINE, 2, f*splits, 0.0f, 0.0f);
needs_sync_=true;
return true;
}
- IMPORT(offset);
+ IMPORT(origin);
IMPORT_PLUS(split_angle,needs_sync_=true);
IMPORT_PLUS(gravity,needs_sync_=true);
IMPORT_PLUS(gradient,needs_sync_=true);
IMPORT(size);
IMPORT(size_as_alpha);
IMPORT(reverse);
+ IMPORT(use_width);
+
+ IMPORT_AS(origin,"offset");
return Layer_Composite::set_param(param,value);
}
if(param=="seed")
return random.get_seed();
EXPORT(bline);
- EXPORT(offset);
+ EXPORT(origin);
EXPORT(split_angle);
EXPORT(gravity);
EXPORT(velocity);
EXPORT(random_factor);
EXPORT(drag);
EXPORT(size);
-
EXPORT(size_as_alpha);
EXPORT(reverse);
+ EXPORT(use_width);
EXPORT_NAME();
ret.push_back(ParamDesc("bline")
.set_local_name(_("Vertices"))
.set_description(_("A list of BLine Points"))
- .set_origin("offset")
+ .set_origin("origin")
.set_hint("width")
);
- ret.push_back(ParamDesc("offset")
- .set_local_name(_("Offset"))
+ ret.push_back(ParamDesc("origin")
+ .set_local_name(_("Origin"))
);
ret.push_back(ParamDesc("gradient")
.set_description(_("Drag slows the growth"))
);
+ ret.push_back(ParamDesc("use_width")
+ .set_local_name(_("Use Width"))
+ .set_description(_("Scale the velocity by the bline's width"))
+ );
+
return ret;
}
dest_surface.set_wh(surface->get_w(),surface->get_h());
dest_surface.clear();
- const Point tl(renddesc.get_tl()-offset);
- const Point br(renddesc.get_br()-offset);
+ const Point tl(renddesc.get_tl()-origin);
+ const Point br(renddesc.get_br()-origin);
const int w(renddesc.get_w());
const int h(renddesc.get_h());