Skip to content

fix: less invasive solve_character_collision_impulses function#652

Merged
sebcrozet merged 2 commits intodimforge:masterfrom
ThierryBerger:collision_solve-no_ownership
Jun 23, 2024
Merged

fix: less invasive solve_character_collision_impulses function#652
sebcrozet merged 2 commits intodimforge:masterfrom
ThierryBerger:collision_solve-no_ownership

Conversation

@ThierryBerger
Copy link
Copy Markdown
Contributor

@ThierryBerger ThierryBerger commented Jun 12, 2024

in solve_character_collision_impulses, Taking ownership of the CharacterCollision is not necessary, it's a problem if we're storing the CharacterCollisions in another struct, such as dimforge/bevy_rapier#523.

This pull request would help avoid a copy of the CharacterCollision.

Using a reference is compatible with an owned Vec and also conveys the information that elements are only read.

Taking ownership of the elements is not necessary.

It also conveys the information that elements are only read.
@sebcrozet sebcrozet force-pushed the collision_solve-no_ownership branch from 92d31b9 to 980bfa6 Compare June 23, 2024 20:44
@sebcrozet sebcrozet merged commit 5308a28 into dimforge:master Jun 23, 2024
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.

2 participants