Skip to content

Instantly share code, notes, and snippets.

@pofulu
Last active March 8, 2019 10:11
Show Gist options
  • Save pofulu/93bba520432a92b9957b713731b7a4cb to your computer and use it in GitHub Desktop.
Save pofulu/93bba520432a92b9957b713731b7a4cb to your computer and use it in GitHub Desktop.
function RotationSignal(signal) {
return RemapSignal(signal, Reactive.val(-180), Reactive.val(180), Reactive.val(Math.PI * -1), Reactive.val(Math.PI));
}
function RemapSignal(value, low1, high1, low2, high2) {
return low2.add(value.sub(low1).mul(high2.sub(low2)).div(high1.sub(low1)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment