Comments (3)
Returning an actual &mut World
would be unsound even with any form of entity disabling, as it still allows you to do structural changes that might affect the disabled entity. And there's also the extreme case where the World
is replaced (i.e. by doing *world = World::new();
)
from bevy.
An approach similar to EntityWorldMut::take
+ EntityWorldMut::insert
could work, but I don't see a way to optimize it to avoid the archetype move, which is pretty costly.
from bevy.
Returning an actual
&mut World
would be unsound even with any form of entity disabling
how about instead of having access to the whole entity (EntityMut
) - you just get access to a set of components?
let _ = world.entity_mut(entity).component_scope::<(Position, Health), _>(|world, (p, h)| {
// blabla
}).unwrap(); // panics if either Position or Health doesn't exist
this can almost be done already with EntityWorldMut::take
+ EntityWorldMut::insert
but it triggers Added
(bad) and it's surprisingly easy to gorget to insert the component back afterwards.
from bevy.
Related Issues (20)
- Be more honest/precise about what mathematical primitive types and values are
- `CubicBezier` should not allow constructing discontinuous curves
- In `0.14.0-rc.2`, minimal app with `bevy_core_pipeline` crashes without `ktx2`, `zstd`, and `bevy_pbr` HOT 4
- the bevy will break down after use feature HOT 1
- Document methods relative to projection HOT 2
- bevy_state doesn't compile when only the `bevy_app` feature is enabled HOT 1
- EntityRef::get_ref should use the change ticks of the System (if it is called from within one) HOT 2
- `Color`-related convenience methods should be more permissive HOT 4
- Rendering Stutter/Ghosting on Vulkan Renderer HOT 2
- AppExit doesn't close the app if called on startup HOT 3
- `bevy_hierarchy` compile error when feature `bevy_app` is disabled HOT 3
- 3d_gizmos example perspective change shader breaks HOT 1
- AssetLoader missing in AssetProcessor
- Shader Error in Array Texture Example: Invalid Field Accessor clip_from_view HOT 1
- Segfault on default app on NixOS/NVIDIA GPU. HOT 1
- RemovedComponents can miss removals in 0.14.0-rc2 HOT 3
- Timer can only finish once per tick HOT 1
- Bevy should supply types and patterns for interpolating transforms with fixed timesteps HOT 1
- First-party parallax backgrounds
- First-party tile maps HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy.