rotating leaf particles, wind perturbation

This commit is contained in:
octarine-noise
2014-08-15 20:24:54 +02:00
parent dcbb636902
commit b407e51d19
6 changed files with 70 additions and 26 deletions

View File

@@ -2,6 +2,7 @@ package mods.betterfoliage.client;
import java.util.Random;
import mods.betterfoliage.BetterFoliage;
import net.minecraft.client.Minecraft;
import net.minecraft.world.World;
import net.minecraftforge.event.world.WorldEvent;
@@ -26,8 +27,8 @@ public class WindTracker {
nextChange = world.getWorldInfo().getWorldTime() + changeTime;
double direction = 2.0 * Math.PI * random.nextDouble();
double speed = Math.abs(random.nextGaussian()) * 0.025;
if (world.isRaining()) speed += Math.abs(random.nextGaussian()) * 0.05;
double speed = Math.abs(random.nextGaussian()) * BetterFoliage.config.fallingLeavesWindStrength.value;
if (world.isRaining()) speed += Math.abs(random.nextGaussian()) * BetterFoliage.config.fallingLeavesStormStrength.value;
targetX = Math.cos(direction) * speed;
targetZ = Math.sin(direction) * speed;
@@ -43,7 +44,7 @@ public class WindTracker {
if (world.getWorldInfo().getWorldTime() >= nextChange) changeWind(world);
// change current wind speed
double changeRate = world.isRaining() ? 0.00075 : 0.00025;
double changeRate = world.isRaining() ? 0.015 : 0.005;
double deltaX = targetX - currentX;
if (deltaX < -changeRate) deltaX = -changeRate;