stride icon indicating copy to clipboard operation
stride copied to clipboard

fix: PhysicsComponent created with GetOrCreate<T> is unusable

Open dloe opened this issue 1 year ago • 0 comments

PR Details

When using GetOrCreate<T> to create physics components such as Rigidbody component, certain properties such as ColliderShape are not properly setup. Setting other properties afterwards result in a no-op.

Added a ReAttach method to PhysicsComponent that can run and reconfigure those properties when ColliderShapes is added. Also added a Test case to showcase.

Related Issue

Issue: https://github.com/stride3d/stride/issues/1504

Types of changes

  • [ ] Docs change / refactoring / dependency upgrade
  • [X] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • [ ] My change requires a change to the documentation.
  • [X] I have added tests to cover my changes.
  • [X] All new and existing tests passed.
  • [X] I have built and run the editor to try this change out.

dloe avatar Aug 27 '24 23:08 dloe