remove CENTER_WORLD_ON_PLAYER feature flag (always enabled now)
This commit is contained in:
parent
ddf197c057
commit
0f5c4d1d89
|
@ -26,7 +26,6 @@ use std::f32::consts::PI;
|
||||||
use std::f64::consts::PI as PI64;
|
use std::f64::consts::PI as PI64;
|
||||||
use crate::{actor, audio, hud, var};
|
use crate::{actor, audio, hud, var};
|
||||||
|
|
||||||
const CENTER_WORLD_ON_PLAYER: bool = true;
|
|
||||||
pub const INITIAL_ZOOM_LEVEL: f64 = 10.0;
|
pub const INITIAL_ZOOM_LEVEL: f64 = 10.0;
|
||||||
|
|
||||||
pub struct CameraPlugin;
|
pub struct CameraPlugin;
|
||||||
|
@ -48,19 +47,18 @@ impl Plugin for CameraPlugin {
|
||||||
.before(TransformSystem::TransformPropagate));
|
.before(TransformSystem::TransformPropagate));
|
||||||
app.insert_resource(MapCam::default());
|
app.insert_resource(MapCam::default());
|
||||||
|
|
||||||
if CENTER_WORLD_ON_PLAYER {
|
// To center the renderer origin on the player camera,
|
||||||
// Disable bevy_xpbd's position->transform sync function
|
// 1. Disable bevy_xpbd's position->transform sync function
|
||||||
app.insert_resource(sync::SyncConfig {
|
app.insert_resource(sync::SyncConfig {
|
||||||
position_to_transform: true,
|
position_to_transform: true,
|
||||||
transform_to_position: false,
|
transform_to_position: false,
|
||||||
});
|
});
|
||||||
// Add own position->transform sync function
|
// 2. Add own position->transform sync function
|
||||||
app.add_systems(PostUpdate, position_to_transform
|
app.add_systems(PostUpdate, position_to_transform
|
||||||
.after(sync::position_to_transform)
|
.after(sync::position_to_transform)
|
||||||
.in_set(sync::SyncSet::PositionToTransform));
|
.in_set(sync::SyncSet::PositionToTransform));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct ShowOnlyInMap {
|
pub struct ShowOnlyInMap {
|
||||||
|
|
Loading…
Reference in a new issue