-
Notifications
You must be signed in to change notification settings - Fork 26
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
CalcCommon additions, minor fixes #132
Conversation
MathCalcCommon::max was changed due to being the exact same implementation as ::clampMin, which is unnecessary, and the new implementation was needed. QuatCalcCommon::setAxisAngle converts and axis and an angle into a quaternion, and a new Vector3CalcCommon::rotate was added for quaternion rotation on a vector. the implementation is matching in some functions, but has a register swap mismatch in others. it's as good as its gonna get for now.
Could you maybe add the two example functions we looked at to get the |
https://decomp.me/scratch/3hHWD instance of both functions matching https://decomp.me/scratch/hXU5w instance of |
@aboood40091 opinions on this? |
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.
lgtm, just one minor nit
include/math/seadQuatCalcCommon.hpp
Outdated
{ | ||
T angleRad = sead::Mathf::deg2rad(angle); | ||
angleRad *= 0.5f; | ||
q.w = cosf(angleRad); |
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.
should this be MathCalcCommon<T>::cos
instead? failing that, std::cos
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.
sead::Mathf::cos
and sead::Mathf::sin
both work perfectly fine and still match. If you would prefer to have sead::MathCalcCommon<f32>::cos
written instead then I can do that as well.
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 would prefer MathCalcCommon<T>
Changed to use standardized MathCalcCommon functions with the template rather than assuming template type.
oops im blind
LGTM |
MathCalcCommon::max was changed due to being the exact same implementation as ::clampMin, which is unnecessary, and the new implementation was needed. QuatCalcCommon::setAxisAngle converts and axis and an angle into a quaternion, and a new Vector3CalcCommon::rotate was added for quaternion rotation on a vector. the implementation is matching in some functions, but has a register swap mismatch in others. it's as good as its gonna get for now.
This change is