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

Rotation APIs: Better exposure for degrees methods #4571

Merged
merged 1 commit into from
May 9, 2016

Conversation

akien-mga
Copy link
Member

Made public the various set/getters for rotations in degrees.
For consistency, renamed the exposed method names to remove the leading
underscore, and kept the old names with a deprecation warning.

Fixes #4511.

Made public the various set/getters for rotations in degrees.
For consistency, renamed the exposed method names to remove the leading
underscore, and kept the old names with a deprecation warning.

Fixes godotengine#4511.
@akien-mga
Copy link
Member Author

I think I found all places where such degrees methods were defined, but if you know of other classes with this mechanism, please tell me.

Until we implement a proper method for deprecating stuff in #4397, I've kept the old names and added a deprecating warning manually.

Note that the current method names are quite versatile, as we have set_rotd, set_rotationd and set_rotation_deg depending on the class. But if we were to change that, it should be done for the radians methods too, and with some more deprecation warnings.

// Could be removed after a couple releases.
Vector3 Spatial::_get_rotation_deg() const {

WARN_PRINT("Deprecated method Spatial._get_rotation_deg(): This method was renamed to get_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted.");
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess nobody uses this method, and even if he does, he shouldn't expect it to work, since it is private API.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well GDScript users don't know if it's private or public in C++, the function was exposed to GDScript, so we need to warn users about it becoming deprecated.

@akien-mga akien-mga merged commit 0dfc4a2 into godotengine:master May 9, 2016
@akien-mga akien-mga deleted the pr-rot-deg branch May 9, 2016 17:08
@djrm
Copy link
Contributor

djrm commented May 12, 2016

There are too many namings for the same function, set_rot, set_rotation, set_rotation_deg, set_rotationd, set_rotd, also there are thing like set_param functions that takes an angle, should we add things like PARAM_ANGLE_DEG, i think is too much bloat, there shoul be only one rotation type function either in degrees or radians and use deg2rad or rad2deg, also it is confusing that angles in the editor are expressed in degrees whereas angles in scripts are expresed in radians, probabily theres a good reason for that, but for beginners i dont think that is friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants