Comments (2)
Another reason why this should be avoided is that OwningPtr
only owns the data, not the allocation, so the proposed conversion would have to leak the allocation.
I would instead suggest using ReflectComponent
to insert a reflected value as component.
from bevy.
Note that for dyn Reflect
we probably want to only do this via the ReflectFromPtr
type data.
The reason for this is because a Box<dyn Reflect>
might not actually be a Box<T>
.
Specifically, when cloning via Reflect::clone_value
, you almost always get back a dynamic type (e.g. Box<DynamicStruct>
). It would be unsafe to treat the OwningPtr
as one that points to T
when it really points to DynamicStruct
.
So ideally we expose this API through the ReflectFromPtr
type data to help ensure these kinds of operations are done safely.
from bevy.
Related Issues (20)
- Increase default font size HOT 4
- Buttons do not update in color_grading example
- Range<f32> is reflectable but not serializable
- when will this support the mmd? HOT 2
- Docs for RenderLayers still contains mention of `TOTAL_LAYERS`, which doesn't exist
- UI Node's dimensions are incorrectly calculated if camera at first node's update had zero size HOT 4
- `Arc2d` does not implement GizmoPrimitive2d HOT 3
- DynamicScene missing docs for entity_map arg in methods
- CI: Make a check which ensures standalone crates actually are standalone HOT 7
- `Gizmos::arc_2d` uses clockwise angles for some reason HOT 2
- GizmoPrimitiveNd for external primitives
- Raycasting for primitives.
- Warnings about unused manifest key and no specified local path etc.. HOT 3
- Dragging window around is very buggy HOT 5
- Gamepad issue HOT 1
- Integrated Intel graphics + GL backend crashes 3d scenes HOT 4
- Suggestion: Rename / Extend Condition Trait Methods. HOT 6
- Add a way to run CI on a specific crate
- Add a simple skybox and envmap for use in examples HOT 3
- Add more query join types (left, right, outer join) HOT 4
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.