28 lines
732 B
Rust
28 lines
732 B
Rust
use bevy::pbr::Atmosphere;
|
|
use bevy::prelude::*;
|
|
|
|
#[derive(Clone, Debug, Default, Component, Reflect)]
|
|
#[reflect(Component)]
|
|
#[require(
|
|
Name = Name::from("2D Camera"),
|
|
Camera2d,
|
|
Transform = Transform::from_xyz(0., 0., 10.),
|
|
)]
|
|
pub struct DemoCamera2d;
|
|
|
|
#[derive(Clone, Debug, Default, Component, Reflect)]
|
|
#[reflect(Component)]
|
|
#[require(
|
|
Name = Name::from("3D Camera"),
|
|
// Atmosphere causes a panic if hdr is not true: https://github.com/bevyengine/bevy/issues/18959
|
|
Camera = Camera {
|
|
hdr: true,
|
|
..default()
|
|
},
|
|
Camera3d,
|
|
Atmosphere = Atmosphere::EARTH,
|
|
Transform = Transform::from_xyz(1., 2., 10.).looking_at(Vec3::ZERO, Dir3::Y),
|
|
PointLight,
|
|
)]
|
|
pub struct DemoCamera3d;
|