mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
Fix gizmos (#15836)
# Objective - Immediate mode gizmos don't have a main world entity but the phase items require `MainEntity` since #15756 ## Solution - Add a dummy `MainEntity` component. ## Testing Both the `3d_gizmos` and `2d_gizmos` examples show gizmos again
This commit is contained in:
parent
da211ee314
commit
5def6f2a58
1 changed files with 5 additions and 1 deletions
|
@ -93,6 +93,7 @@ use crate::config::GizmoMeshConfig;
|
||||||
use {
|
use {
|
||||||
bevy_ecs::{
|
bevy_ecs::{
|
||||||
component::Component,
|
component::Component,
|
||||||
|
entity::Entity,
|
||||||
query::ROQueryItem,
|
query::ROQueryItem,
|
||||||
system::{
|
system::{
|
||||||
lifetimeless::{Read, SRes},
|
lifetimeless::{Read, SRes},
|
||||||
|
@ -109,7 +110,7 @@ use {
|
||||||
ShaderStages, ShaderType, VertexFormat,
|
ShaderStages, ShaderType, VertexFormat,
|
||||||
},
|
},
|
||||||
renderer::RenderDevice,
|
renderer::RenderDevice,
|
||||||
sync_world::TemporaryRenderEntity,
|
sync_world::{MainEntity, TemporaryRenderEntity},
|
||||||
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
|
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
|
||||||
},
|
},
|
||||||
bytemuck::cast_slice,
|
bytemuck::cast_slice,
|
||||||
|
@ -467,6 +468,9 @@ fn extract_gizmo_data(
|
||||||
render_layers: config.render_layers.clone(),
|
render_layers: config.render_layers.clone(),
|
||||||
handle: handle.clone(),
|
handle: handle.clone(),
|
||||||
},
|
},
|
||||||
|
// The immediate mode API does not have a main world entity to refer to,
|
||||||
|
// but we do need MainEntity on this render entity for the systems to find it.
|
||||||
|
MainEntity::from(Entity::PLACEHOLDER),
|
||||||
TemporaryRenderEntity,
|
TemporaryRenderEntity,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue