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

Sync frame 0.5 #44

Merged
merged 1 commit into from
Feb 4, 2024
Merged

Sync frame 0.5 #44

merged 1 commit into from
Feb 4, 2024

Conversation

malleoz
Copy link
Contributor

@malleoz malleoz commented Feb 3, 2024

This matches the expected values of KartDynamics::m_pos and KartDynamics::m_fullRot after the call to KartObject::calcSub. Only variables which are dependent on the synchronization of these two variables have been implemented.

Further additions in the functions added in this PR may be required in order to sync the second pass.

@malleoz malleoz force-pushed the frame_0_point_5 branch 2 times, most recently from 57e6c33 to c355d89 Compare February 3, 2024 06:45
Comment on lines +47 to +66
f32 dot_ = std::max(-1.0f, std::min(1.0f, dot(q1)));
bool bDot = dot_ < 0.0f;
dot_ = std::abs(dot_);

f32 acos = Mathf::acos(dot_);
f32 sin = Mathf::sin(acos);

f32 s;
if (std::abs(sin) < 0.00001f) {
s = 1.0f - t;
} else {
f32 invSin = 1.0f / sin;
f32 tmp0 = t * acos;
s = invSin * Mathf::sin(acos - tmp0);
t = invSin * Mathf::sin(tmp0);
}
Copy link
Owner

Choose a reason for hiding this comment

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

I'm currently debating whether or not to standardize the Mathf namespace within EGG - I'm leaning towards standardizing it, as max, min, and abs are trivially easy to implement into Mathf, whereas sin and sqrt cannot be implemented into std. I'm interested in hearing more thoughts.

Comment on lines +39 to +42
void KartMove::setKartSpeedLimit() {
constexpr f32 limit = 120.0f;
m_hardSpeedLimit = limit;
}
Copy link
Owner

Choose a reason for hiding this comment

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

This function is so simple and easy to understand that it might not even be worth using constexpr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Up to you, given you work with constexpr more than I have.

@vabold vabold merged commit 9716cd0 into vabold:main Feb 4, 2024
2 checks passed
@malleoz malleoz deleted the frame_0_point_5 branch March 31, 2024 16:58
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