-
Notifications
You must be signed in to change notification settings - Fork 12
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
Sync frame 0.5 #44
Conversation
57e6c33
to
c355d89
Compare
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); | ||
} |
There was a problem hiding this comment.
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.
void KartMove::setKartSpeedLimit() { | ||
constexpr f32 limit = 120.0f; | ||
m_hardSpeedLimit = limit; | ||
} |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
c355d89
to
f09cb29
Compare
f09cb29
to
15080bb
Compare
This matches the expected values of
KartDynamics::m_pos
andKartDynamics::m_fullRot
after the call toKartObject::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.