private void Update(EvaluationContext context) { var t = (float)EvaluationContext.BeatTime * 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 ); }
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 ); }