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

Curvy Cruves #482

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Curvy Cruves #482

wants to merge 8 commits into from

Conversation

Pirulax
Copy link
Collaborator

@Pirulax Pirulax commented Sep 17, 2022

Will have to test it.

source/game_sa/Curves.cpp Show resolved Hide resolved
source/game_sa/Curves.cpp Outdated Show resolved Hide resolved
@Pirulax
Copy link
Collaborator Author

Pirulax commented Sep 22, 2024

Have you tested it?

@Vladik01-11
Copy link
Contributor

Have you tested it?

Yes, the current CCurves::CalcCorrectedDist code is not perfect and needs to be looked at again

@Vladik01-11
Copy link
Contributor

Tested, it seems to work just fine.

@@ -74,58 +75,9 @@ void CCurves::CalcCurvePoint(
) {
timeProgress = std::clamp(timeProgress, 0.f, 1.f);

const auto [pos, speedScale] = [&]() -> std::tuple<CVector, float> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so you just removed this code? You should just comment it out.

Copy link
Contributor

Choose a reason for hiding this comment

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

you're absolutely right.

Comment on lines +137 to +141
const auto curveFactor = CalcSpeedVariationInBend(startPos, endPos, startDir, endDir);
const auto curvePoint = lerp(startPos, endPos, timeProgress);

outPos = curvePoint + (curveFactor * (endDir - startDir));
outSpeed = lerp(startDir, endDir, timeProgress) / ((float)totalTimeMs / 1000.f);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tbh i'd just not hook it
this code can't possibly be 100% correct

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.

3 participants