📄 src/main.rs
mod bunny;
mod dog;

use bevy::{
    DefaultPlugins,
    app::{App, Startup},
    camera::{Camera3d, OrthographicProjection, Projection, ScalingMode},
    ecs::system::Commands,
    light::{AmbientLight, DirectionalLight},
    math::Vec3,
    transform::components::Transform,
};

use crate::bunny::BunnySystems;
use crate::dog::DogSystems;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, setup)
        .add_dog_systems()
        .add_bunny_systems()
        .run();
}

fn setup(mut commands: Commands) {
    commands.spawn((
        Camera3d::default(),
        Projection::from(OrthographicProjection {
            scaling_mode: ScalingMode::FixedVertical {
                viewport_height: 10.0,
            },
            ..OrthographicProjection::default_3d()
        }),
        AmbientLight {
            brightness: 1000.0,
            ..Default::default()
        },
        Transform::from_xyz(0.0, 10.0, -5.0).looking_at(Vec3::ZERO, Vec3::Z),
    ));

    commands.spawn((
        DirectionalLight {
            illuminance: 15000.0,
            ..Default::default()
        },
        Transform::from_xyz(0.0, 0.0, 0.0).looking_to(Vec3::NEG_Y, Vec3::Z),
    ));
}