Skip to content

ArgumentOutOfRangeException fix #27

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

Merged
merged 4 commits into from
Apr 24, 2022
Merged

Conversation

Leprawel
Copy link
Contributor

@Leprawel Leprawel commented Feb 17, 2022

A fix for a problem I ran into while testing high speed tank tracks.

The problem:
If normalizedT is equal or over 2 current correction will make it at most 1. This will cause
float t = normalizedT * ( m_loop ? endPoints.Count : ( endPoints.Count - 1 ) );
(...)
int startIndex = (int) t;
to make startIndex equal to or more than endPoints.Count and will cause ArgumentOutOfRangeException here:
startPoint = endPoints[startIndex];

Fix fixes that.

Copy link
Owner

@yasirkula yasirkula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change all such occurrences in BezierSpline.cs and BezierDataStructures.cs.

@Leprawel Leprawel requested a review from yasirkula February 20, 2022 18:29
Copy link
Owner

@yasirkula yasirkula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@yasirkula yasirkula merged commit dd4d4bb into yasirkula:master Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants