split_angle(Angle::deg(10)),
gravity(0,-0.1),
velocity(0.3),
+ perp_velocity(0.3),
step(0.01),
sprouts(10)
{
Real stunt_growth(random_factor * random(Random::SMOOTH_COSINE,i,f+seg,0.0f,0.0f)/2.0+0.5);
stunt_growth*=stunt_growth;
- Vector branch_velocity(deriv(f).norm()*velocity);
+ if((((i+1)*sprouts + steps/2) / steps) > branch_count) {
+ Vector branch_velocity(deriv(f).norm()*velocity + deriv(f).perp().norm()*perp_velocity);
- 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);
+ 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);
- if((((i+1)*sprouts + steps/2) / steps) > branch_count) {
branch_count++;
branch(i, 0, 0, // time
stunt_growth, // stunt growth
IMPORT_PLUS(gravity,needs_sync_=true);
IMPORT_PLUS(gradient,needs_sync_=true);
IMPORT_PLUS(velocity,needs_sync_=true);
+ IMPORT_PLUS(perp_velocity,needs_sync_=true);
IMPORT_PLUS(step,needs_sync_=true);
IMPORT_PLUS(splits,needs_sync_=true);
IMPORT_PLUS(sprouts,needs_sync_=true);
EXPORT(split_angle);
EXPORT(gravity);
EXPORT(velocity);
+ EXPORT(perp_velocity);
EXPORT(step);
EXPORT(gradient);
EXPORT(splits);
);
ret.push_back(ParamDesc("velocity")
- .set_local_name(_("Velocity"))
- .set_description(_("Amount to which shoots tend to follow the tangent of the BLine"))
+ .set_local_name(_("Tangential Velocity"))
+ .set_description(_("Amount to which shoots tend to grow along the tangent to the BLine"))
+ );
+
+ ret.push_back(ParamDesc("perp_velocity")
+ .set_local_name(_("Perpendicular Velocity"))
+ .set_description(_("Amount to which shoots tend to grow perpendicular to the tangent to the BLine"))
);
ret.push_back(ParamDesc("size")