bevy-camera-systems

Installation
SKILL.md

Bevy camera systems (docs-first stub)

Not a full port. A camera is an entity with camera components and a Transform. Follow and shake are not copied from Godot.

When to use

Load this when a view must render 2D or 3D. bevy::camera on docs.rs latest (0.20.0) and the two_passes example embedded there are the sources for the names below.

ECS shape

  • Components: Camera is the viewpoint (projection and render target). A Camera with no render graph errors at runtime. Camera2d enables the 2D graph and requires Camera, Projection, and Frustum. Camera3d enables the main 3D graph and requires Camera and Projection. 3D space is right-handed: X right, Y up, Z back, so forward is -Z.
  • Spawn: the example uses commands.spawn((Camera3d::default(), Transform::from_xyz(...).looking_at(Vec3::ZERO, Vec3::Y))). A second camera sets Camera { order: 1, clear_color: ClearColorConfig::None, ..default() } so it draws on top without clearing.
  • Query: systems may take (&mut Camera, &GlobalTransform) with With<Camera3d>. Camera::viewport_to_world_2d maps a viewport position to a 2D world position for an orthographic camera along Z.
  • Schedule: spawn on Startup. A follow system, if you write one, is your own Update system over Transform. This file does not name a follow component.

Godot idea to Bevy idiom

Installs
3
GitHub Stars
839
First Seen
2 days ago