-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
state: readyThis issue is ready to be implementedThis issue is ready to be implementedtype: enhancementNew feature or requestNew feature or request
Description
Feature
Improve the new API:
- Use
Appeverywhere instead ofContextfor more flexibility - Avoid splitting data between local node and glob, and instead put everything on glob side
- Ensure valid state at any time by applying full glob update each time a glob field is modified
Tasks
- Replace
ContextbyApp#315 - Add
FromApp#316 - Require
FromAppto be implemented for all glob types #317 - Refactor globs #318
- Allow mutable borrowing of multiple root nodes #320
- Replace nodes by states #321
- Support
Instantcreation inFromAppderive macro #322 - Allow glob mutation with
Globals#323 - Add updater traits and derive macros #324
- Change physics API #325
- Change resource API #326
- Change material api #328
- Simplify updaters
- Don't generate
for_*methods (so updater fields can beOptioninstead ofUpdate) - Generation
*_optionmethods to simplify updaters calling other updaters - Generate updater fields with
updater(inner_type)only to support custom methods - Rename attributes
- Generate field only ->
updater(field) - Generate methods + fields ->
updater(methods)
- Generate field only ->
- Don't generate
- Add
Inittrait to initalize automatically afterFromApp::from_app()call - Make ... a glob a glob and implements GlobUpdater
- Optimize state index access in
App(see Snippet 1)- Actually, current version is convenient to have a way to control state update ordering.
- Avoid storing the GPU objects in an
Arc, and useApp::takeinstead - Perform last global cleanup/refactoring if necessary, including:
- Remove unnecessary
app.update()in tests - Put most objects outside
Rootin tests to simplify borrowing - Remove
FontManagerand instead update allText2Dwhen the font is updated. - Make sure all
structfielddoc references are still valid.
- Remove unnecessary
- Allow deletion of states (and provide
State::delete()callback, for example to delete recursively)- Possible issue: delete state of type
T, and then runStateHandle::<T>::get - Possible issue: what happens to
Globs whenGlobalsstate is deleted?
- Possible issue: delete state of type
- Either replace
GlobRefbyGlob, or disallow mutation fromGlobRef. - Implement
From/Into<[f32; N]>forVec2,Vec3, ... - Add
ModelMapperto derivate a set of models dynamically (for picking, shadow maps, ...) - Get access to shader + textures + raw material data + material type ID from
MaterialGlob - Add
is_main_renderingfield inTarget - Ensure that when
TextureAnimation.partfield is updated, the current frame is reset
Snippet 1:
fn root_index_or_create<T>(&mut self) -> usize
where
T: RootNode,
{
let type_id = TypeId::of::<T>();
let index = *self
.root_indexes
.entry(type_id)
.or_insert_with(|| self.roots.len());
if index == self.roots.len() {
debug!("Create root node `{}`...", any::type_name::<T>());
// reserve slot in case other root node is creating during T::from_app_with
let root = T::from_app_with(self, T::init);
self.roots.push(RootNodeData::new::<T>(root));
debug!("Root node `{}` created", any::type_name::<T>());
}
index
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
state: readyThis issue is ready to be implementedThis issue is ready to be implementedtype: enhancementNew feature or requestNew feature or request