RoR2-ChensHelpers

Contains simple and useful helpers for RoR2 mod creators to use. Mainly caters to Chen's mods.

View on GitHub

ChensHelpers

Chen.Helpers.MathHelpers.Wave

Wave.InvertedSawtooth(float, float, float, float) Method

Computes for an Inverted Sawtooth Wave. Always multiply this to the original value.

public static float InvertedSawtooth(float phase, float frequency, float amplitude, float baseValue);

Parameters

phase System.Single
Offset from time

frequency System.Single
Number of complete cycles in a given time

amplitude System.Single
Maximum and minimum values

baseValue System.Single
Offset from the result

Returns

System.Single
The computed value for the wave