private static IFlowField GenerateFlowField() { var f = new SimpleFlowField(50, 1, 50, new Vector3(25, 0.5f, 25)); //Start random f.Randomize(1); //Swirl around center //Half the field is a swirl (basically just concentric circles) while the other half has a slight bias to spiral inwards towards the center f.Func(pos => Vector3.Lerp(pos / 5, Vector3.Normalize(Vector3.Cross(pos, Vector3.UnitY)), pos.X > 0.5f ? 0.75f : 0.9f), 0.85f); //Keep it flat on the plane f.ClampXZ(); //Clean NaN values f.Clean(); return f; }
private static IFlowField GenerateFlowField() { var f = new SimpleFlowField(50, 1, 50, new Vector3(25, 0.5f, 25)); //Start random f.Randomize(1); //Swirl around center //Half the field is a swirl (basically just concentric circles) while the other half has a slight bias to spiral inwards towards the center f.Func(pos => Vector3.Lerp(pos / 5, Vector3.Normalize(Vector3.Cross(pos, Vector3.UnitY)), pos.X > 0.5f ? 0.75f : 0.9f), 0.85f); //Keep it flat on the plane f.ClampXZ(); //Clean NaN values f.Clean(); return(f); }