Explain Camera2dBundle.projection needs to be set carefully (#11115)

Encountered it while implementing
https://github.com/bevyengine/bevy/pull/11109.

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This commit is contained in:
Stepan Koltsov 2024-03-18 17:35:33 +00:00 committed by GitHub
parent 5cf7d9213e
commit 2c953914bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,