Skip to content

Commit

Permalink
Explain Camera2dBundle.projection needs to be set carefully (#11115)
Browse files Browse the repository at this point in the history
Encountered it while implementing
#11109.

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
  • Loading branch information
stepancheg and alice-i-cecile authored Mar 18, 2024
1 parent 5cf7d92 commit 2c95391
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bevy_core_pipeline/src/core_2d/camera_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ pub struct Camera2d;
pub struct Camera2dBundle {
pub camera: Camera,
pub camera_render_graph: CameraRenderGraph,
/// Note: default value for `OrthographicProjection.near` is `0.0`
/// which makes objects on the screen plane invisible to 2D camera.
/// `Camera2dBundle::default()` sets `near` to negative value,
/// so be careful when initializing this field manually.
pub projection: OrthographicProjection,
pub visible_entities: VisibleEntities,
pub frustum: Frustum,
Expand Down

0 comments on commit 2c95391

Please sign in to comment.