Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable lenses to avoid change detection (#124)
Add the ability for all `Lens`es to avoid triggering change detection if they don't make any actual change to their target (component or asset). This change modifies the signature of `Lerp::lerp()` to take `&mut dyn Targetable<T>` instead of `&mut T`. The `Targetable<T>` acts as a `Mut<T>`, marking the target as changed only if actually dereferenced mutably. Note that we cannot use `Mut<T>` directly because we can't obtain a `Mut<A: Asset>` without marking the asset as mutable; see bevyengine/bevy#13104. Fixes #91
- Loading branch information