Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/primed merge #219

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Added

- Added primed axis merge mode to axis merge
- Added Settings
- New setting: Start minimized
- New setting: Minimize to tray on close
Expand Down
7 changes: 6 additions & 1 deletion UCR.Plugins/Remapper/AxisMerger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public enum AxisMergerMode
{
Average,
Greatest,
Sum
Sum,
Primed
}

public AxisMerger()
Expand Down Expand Up @@ -74,11 +75,15 @@ public override void Update(params short[] values)
case AxisMergerMode.Sum:
valueOutput = Functions.ClampAxisRange(valueHigh + valueLow);
break;
case AxisMergerMode.Primed:
valueOutput = (short) (valueHigh - ((double) valueHigh / (valueLow < 0? Constants.AxisMinValue : Constants.AxisMaxValue ) - 1) * (double) valueLow);
break;
default:
valueOutput = 0;
break;
}

//does deadzone and sensitivity make sense for a merge? Kinda weird for avg merge and is more of a pothole and a speedbump for primed merge mode I just added, unless it were to be applied to inputs instead of outputs
if (DeadZone != 0)
{
valueOutput = _deadZoneHelper.ApplyRangeDeadZone(valueOutput);
Expand Down