Skip to content

Commit 2c95391

Browse files
Explain Camera2dBundle.projection needs to be set carefully (#11115)
Encountered it while implementing #11109. Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
1 parent 5cf7d92 commit 2c95391

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/bevy_core_pipeline/src/core_2d/camera_2d.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ pub struct Camera2d;
2222
pub struct Camera2dBundle {
2323
pub camera: Camera,
2424
pub camera_render_graph: CameraRenderGraph,
25+
/// Note: default value for `OrthographicProjection.near` is `0.0`
26+
/// which makes objects on the screen plane invisible to 2D camera.
27+
/// `Camera2dBundle::default()` sets `near` to negative value,
28+
/// so be careful when initializing this field manually.
2529
pub projection: OrthographicProjection,
2630
pub visible_entities: VisibleEntities,
2731
pub frustum: Frustum,

0 commit comments

Comments
 (0)