Skip to content

Fix Body.DestroyFixture()#39

Merged
Kira-PH merged 2 commits intocodingben:v2.4from
NArnott:fixDestroyFixture
Jan 4, 2022
Merged

Fix Body.DestroyFixture()#39
Kira-PH merged 2 commits intocodingben:v2.4from
NArnott:fixDestroyFixture

Conversation

@NArnott
Copy link
Copy Markdown
Collaborator

@NArnott NArnott commented Jan 4, 2022

Fixed 2 of 3 use cases that broke fixtures when using Body.DestroyFixture #38.

I implemented those use cases in 3 new unit tests, for when the Fixture to be destroyed is

  • At the start of the linked list (was broken)
  • In the middle of the linked list (was broken)
  • At the end of the linked list (worked)

While I was in that method, I also implemented an optimization for when to Reset the Mass of the Body based on https://github.com/erincatto/box2d/blob/9dc24a6fd4f32442c4bcf80791de47a0a7d25afb/src/dynamics/b2_body.cpp#L284

@Kira-PH Kira-PH merged commit 031788a into codingben:v2.4 Jan 4, 2022
@NArnott NArnott deleted the fixDestroyFixture branch January 4, 2022 14:32
@codingben
Copy link
Copy Markdown
Owner

@NArnott v2.4.5 released. 😄

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants