chore: cleanup

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-10-26 00:43:25 +02:00
parent 23f0b5f880
commit ec468b6752
3 changed files with 8 additions and 36 deletions

View File

@@ -54,11 +54,7 @@ impl Plugin for ModelNodePlugin {
app.init_resource::<MaterialRegistry>();
app.add_systems(
Update,
(
load_models,
gen_model_parts,
apply_materials,
)
(load_models, gen_model_parts, apply_materials)
.chain()
.in_set(ModelNodeSystemSet),
);
@@ -71,9 +67,9 @@ impl Plugin for ModelNodePlugin {
#[bindless(index_table(range(50..51), binding(100)))]
pub struct HoldoutExtension {}
impl From<&HoldoutExtension> for u32 {
fn from(_: &HoldoutExtension) -> Self {
0
}
fn from(_: &HoldoutExtension) -> Self {
0
}
}
impl MaterialExtension for HoldoutExtension {
fn fragment_shader() -> ShaderRef {

View File

@@ -31,7 +31,6 @@ impl Plugin for SpatialNodePlugin {
PostUpdate,
(
spawn_spatial_nodes,
// update_spatial_node_parenting,
despawn_unneeded_spatial_nodes,
update_spatial_nodes,
)
@@ -54,32 +53,6 @@ fn spawn_spatial_nodes(mut cmds: Commands) {
}
}
fn update_spatial_node_parenting(
query: Query<(Entity, Option<&ChildOf>, &SpatialNode)>,
mut cmds: Commands,
) {
for (entity, parent, spatial) in &query {
let Some(spatial) = spatial.0.upgrade() else {
continue;
};
let Some(parent_entity) = spatial
.get_parent()
.map(|v| v.entity.read().as_ref().map(|v| v.0))
else {
continue;
};
// no changes needed, early exit
if parent.map(|v| v.0) == parent_entity {
continue;
}
match parent_entity {
Some(e) => cmds.entity(entity).insert(ChildOf(e)),
None => cmds.entity(entity).remove::<ChildOf>(),
};
}
}
fn despawn_unneeded_spatial_nodes(query: Query<(Entity, &SpatialNode)>, cmds: ParallelCommands) {
query.par_iter().for_each(|(entity, spatial_node)| {
if spatial_node.0.upgrade().is_none() {

View File

@@ -34,7 +34,10 @@ impl Plugin for HandPlugin {
app.add_systems(PreFrameWait, update_hands.run_if(resource_exists::<Hands>));
app.add_systems(XrSessionCreated, create_trackers);
app.add_systems(XrPreDestroySession, destroy_trackers);
app.add_systems(PostUpdate, update_hand_material.run_if(resource_exists::<Hands>));
app.add_systems(
PostUpdate,
update_hand_material.run_if(resource_exists::<Hands>),
);
app.add_systems(Startup, setup.run_if(session_available));
}
}