You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A game that displays a hand of cards that changes the rotation of the card depending on the index in the hand. If there is an odd number of cards the center card should have no rotation
Describe the problem or limitation you are having in your project
To determine the rotation I am using remap in the following way. (i is the index in the hand)
After thinking on this for a while, I'm not sure if my proposal of using the midpoint is going to be intuitive. I could see cases where people would expect ostart and others where they would expect ostop. Maybe NaN is the intended/intuitive behaviour and should be treated as such. If so it might be worth adding to the docs about this NaN case 🤔
Protecting against NaN would only make sense if remap also clamped values in its input range. So like you said, instead of changing behavior, this should be documented accordingly.
Describe the project you are working on
A game that displays a hand of cards that changes the rotation of the card depending on the index in the hand. If there is an odd number of cards the center card should have no rotation
Describe the problem or limitation you are having in your project
To determine the rotation I am using remap in the following way. (
i
is the index in the hand)This works well except in the case of
hand.size()
returning 1 (and thusi
being 0). This has necessitated special case handling by checking for nanDescribe the feature / enhancement and how it helps to overcome the problem or limitation
This proposal is to determine when
istart
andistop
are the same, and to return the halfway point ofostart
andostop
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Update the remap functions in core\math\math_funcs.h to detect when istart and istop are the same and use 0.5 in its place
If this enhancement will not be used often, can it be worked around with a few lines of script?
you can guard against this with
is_nan()
but that requires knowing about this caseIs there a reason why this should be core and not an add-on in the asset library?
This is about improving the core engine API to be friendlier to work with
The text was updated successfully, but these errors were encountered: