fix(Spatial/Transforms): fix transform propagation by making bevy entities for all spatials

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-08-31 05:08:46 +02:00
parent eac44ded78
commit a14457ecc1
5 changed files with 87 additions and 37 deletions

View File

@@ -242,6 +242,7 @@ fn build_line_mesh(
extension: LineExtension { unused: 0 },
})),
));
lines.spatial.set_entity(e.id());
_ = lines.entity.set(e.id().into());
e
}

View File

@@ -243,6 +243,7 @@ fn gen_model_parts(
});
spatial.set_local_transform(transform.compute_matrix());
spatial.set_entity(entity);
cmds.entity(entity)
.insert(SpatialNode(Arc::downgrade(&spatial)));
let mesh_entity = children_query
@@ -570,7 +571,6 @@ impl Model {
);
}
None => {
// TODO: this could be a denail of service vector
let client = self.spatial.node().unwrap().get_client().unwrap();
let part_node = client.scenegraph.add_node(Node::generate(&client, false));
let spatial = Spatial::add_to(

View File

@@ -168,6 +168,7 @@ fn spawn_text(
.add_children(&letters)
.id();
text.entity.lock().replace(EntityHandle(entity));
text.spatial.set_entity(entity);
}
}