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

Removes some unused functions and variables #64802

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

benbot
Copy link

@benbot benbot commented Aug 23, 2022

Removes some unused functions that @lyuma discovered while working on Skeleton3D and some unused variables I discovered while working on a water physics module.

@benbot benbot requested review from a team as code owners August 23, 2022 21:26
@benbot
Copy link
Author

benbot commented Aug 23, 2022

cc @fire

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

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

Removing skeleton functions that have no users in the engine and are badly modifying internal state without going through the skeleton API and thus incorrectly.

  • set_bone_children
  • add_bone_child
  • remove_bone_child

Removed comments.

@reduz

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

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

Can you explain the reasoning for these removals?

linear_velocity = p_state->get_linear_velocity();
angular_velocity = p_state->get_angular_velocity();
inverse_inertia_tensor = p_state->get_inverse_inertia_tensor();

According to the pr guidelines the commit message need to be informative, and we need bug reports for the two commits of the skeleton removal and these physics changes.

@benbot
Copy link
Author

benbot commented Aug 24, 2022

Those variables were not being used in the rigid body’s _body_state_changed function.

it made reading the code a little confusing since, at a glance, you’d expect some physics calculations using those variables, but since there were none they should be safe to remove

@benbot
Copy link
Author

benbot commented Aug 24, 2022

I can separate out the removal of those variables into its own commit, if that would be better

@fire
Copy link
Member

fire commented Aug 24, 2022

One commit is fine, can you revise the commit message.

@benbot
Copy link
Author

benbot commented Aug 24, 2022

@fire done. lmk if that's any better

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

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

Since I and Lyuma proposed this, need someone like @akien-mga or @reduz to check for style and general architecture.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Style wise it's fine, but I can't say if the removal is fine, I'm not familiar enough with the Skeleton3D bones workflow.

@akien-mga
Copy link
Member

@reduz says:

I have no idea what these are for, should probably use blame to find out

Seems like those were added by @TwistedTwigleg in #51368. This predates later Skeleton3D / bone refactoring so it might indeed be obsolete. Would be nice if TwistedTwigleg could confirm :)

@TwistedTwigleg
Copy link
Contributor

These functions were added as part of the Skeleton refactor to remove BoneAttachment3D and make it a modification super early on in my work on GSoC, before the system was really figured out and before Skeleton3D got major changes to how it all works internally. It can be removed - it is non-necessary and can be removed 👍

@akien-mga akien-mga merged commit 7803323 into godotengine:master Aug 25, 2022
@akien-mga
Copy link
Member

Thanks!

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.

6 participants