private void Update(EvaluationContext context) { var t = OverrideTime.IsConnected ? OverrideTime.GetValue(context) : (float)context.LocalFxTime * SpeedFactor.GetValue(context); //var value = Value.GetValue(context); var amplitude = Amplitude.GetValue(context); var period = Period.GetValue(context); var offset = Offset.GetValue(context); var phase = Phase.GetValue(context); var amplitudeScale = AmplitudeScale.GetValue(context); Result.Value = new Vector3( (float)Math.Sin(t / period.X + phase.X) * amplitude.X * amplitudeScale + offset.X, (float)Math.Sin(t / period.Y + phase.Y) * amplitude.Y * amplitudeScale + offset.Y, (float)Math.Sin(t / period.Z + phase.Z) * amplitude.Z * amplitudeScale + offset.Z ); }
private void Update(EvaluationContext context) { var value = OverrideTime.IsConnected ? OverrideTime.GetValue(context) : (float)context.LocalFxTime; var seed = Seed.GetValue(context); var period = Frequency.GetValue(context); var octaves = Octaves.GetValue(context); var rangeMin = RangeMin.GetValue(context); var rangeMax = RangeMax.GetValue(context); var scale = Scale.GetValue(context); var scaleXYZ = ScaleXYZ.GetValue(context); Result.Value = new Vector3( (MathUtils.PerlinNoise(value, period, octaves, seed) + 1f) * 0.5f * (rangeMax.X - rangeMin.X) + rangeMin.X, (MathUtils.PerlinNoise(value, period, octaves, seed + 123) + 1f) * 0.5f * (rangeMax.Y - rangeMin.Y) + rangeMin.Y, (MathUtils.PerlinNoise(value, period, octaves, seed + 234) + 1f) * 0.5f * (rangeMax.Z - rangeMin.Z) + rangeMin.Z) * scaleXYZ * scale; }
private void Update(EvaluationContext context) { var value = OverrideTime.IsConnected ? OverrideTime.GetValue(context) : (float)context.LocalFxTime; var seed = Seed.GetValue(context); var period = Frequency.GetValue(context); var octaves = Octaves.GetValue(context); //var zoom = Zoom.GetValue(context); var rangeMin = RangeMin.GetValue(context); var rangeMax = RangeMax.GetValue(context); var scale = Scale.GetValue(context); //var noiseSum = ComputePerlinNoise(value, period, octaves, seed); var noiseSum = MathUtils.PerlinNoise(value, period, octaves, seed); var dist = rangeMax - rangeMin; Result.Value = ((scale * noiseSum + 1f) * 0.5f * dist + rangeMin); }
private void Update(EvaluationContext context) { _phase = Phase.GetValue(context); _bias = Bias.GetValue(context); _shape = (Shapes)Shape.GetValue(context); _ratio = Ratio.GetValue(context); var time = OverrideTime.IsConnected ? OverrideTime.GetValue(context) : EvaluationContext.BeatTime; var rate = Rate.GetValue(context); var t = time * rate; LastFraction = (float)MathUtils.Fmod(t, 1); var normalizedValue = CalcNormalizedValueForFraction(t); Result.Value = normalizedValue * Amplitude.GetValue(context) + Offset.GetValue(context); }
private void Update(EvaluationContext context) { //var t = (float)context.Playback.BeatTime * SpeedFactor.GetValue(context); var t = OverrideTime.IsConnected ? OverrideTime.GetValue(context) : (float)context.LocalFxTime * SpeedFactor.GetValue(context); //var value = Value.GetValue(context); var amplitude = Amplitude.GetValue(context); var period = Period.GetValue(context); var offset = Offset.GetValue(context); var phase = Phase.GetValue(context); var amplitudeScale = AmplitudeScale.GetValue(context); Result.Value = new System.Numerics.Vector2( (float)Math.Sin(t / period.X + phase.X) * amplitude.X * amplitudeScale + offset.X, (float)Math.Sin(t / period.Y + phase.Y) * amplitude.Y * amplitudeScale + offset.Y ); }