fix camera arm height
This commit is contained in:
@@ -20,6 +20,7 @@ pub struct CameraState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component, Reflect, Debug)]
|
#[derive(Component, Reflect, Debug)]
|
||||||
|
#[reflect(Component)]
|
||||||
pub struct MainCamera {
|
pub struct MainCamera {
|
||||||
dir: Dir3,
|
dir: Dir3,
|
||||||
distance: f32,
|
distance: f32,
|
||||||
@@ -35,6 +36,8 @@ impl MainCamera {
|
|||||||
pub fn plugin(app: &mut App) {
|
pub fn plugin(app: &mut App) {
|
||||||
app.register_type::<CameraRotation>();
|
app.register_type::<CameraRotation>();
|
||||||
app.register_type::<CameraState>();
|
app.register_type::<CameraState>();
|
||||||
|
app.register_type::<MainCamera>();
|
||||||
|
|
||||||
app.init_resource::<CameraState>();
|
app.init_resource::<CameraState>();
|
||||||
app.add_systems(Startup, startup);
|
app.add_systems(Startup, startup);
|
||||||
app.add_systems(Update, (update, rotate_view_keyboard, rotate_view_gamepad));
|
app.add_systems(Update, (update, rotate_view_keyboard, rotate_view_gamepad));
|
||||||
@@ -43,7 +46,7 @@ pub fn plugin(app: &mut App) {
|
|||||||
fn startup(mut commands: Commands) {
|
fn startup(mut commands: Commands) {
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
Camera3d::default(),
|
Camera3d::default(),
|
||||||
MainCamera::new(Vec3::new(0., 1., -12.)),
|
MainCamera::new(Vec3::new(0., 2., -12.)),
|
||||||
CameraRotation(0.),
|
CameraRotation(0.),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user