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

Add world.removeContactMaterial method #128

Merged
merged 1 commit into from
Jan 18, 2022

Conversation

Glavin001
Copy link

@Glavin001 Glavin001 commented Jan 8, 2022

  • Add method removeContactMaterial to World
    • Name matches the convention, such as removeContraint
  • Add method delete to TupleDictionary
  • Add tests

@Glavin001
Copy link
Author

After this is merged I can update use-cannon as well: https://github.com/pmndrs/use-cannon/pull/317/files#r780628329

Comment on lines 451 to 456
if (idx !== -1) {
this.contactmaterials.splice(idx, 1)
}
this.contactMaterialTable.delete(cmat.materials[0].id, cmat.materials[1].id)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (idx !== -1) {
this.contactmaterials.splice(idx, 1)
}
this.contactMaterialTable.delete(cmat.materials[0].id, cmat.materials[1].id)
if (idx === -1) {
return
}
this.contactmaterials.splice(idx, 1)
this.contactMaterialTable.delete(cmat.materials[0].id, cmat.materials[1].id)

why is contactMaterialTable.delete not under the check?

Copy link
Author

@Glavin001 Glavin001 Jan 18, 2022

Choose a reason for hiding this comment

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

I think I copied from removeConstraint method.

No objections to the suggested change, thanks!

Pushed update.

Copy link
Member

@marcofugaro marcofugaro left a comment

Choose a reason for hiding this comment

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

Thank you!

@marcofugaro marcofugaro changed the title Add world.removeContactMaterial method Add world.removeContactMaterial method Jan 18, 2022
@marcofugaro marcofugaro merged commit 524e6d7 into pmndrs:master Jan 18, 2022
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