Keep camera in positive Z

This commit is contained in:
Jan Hohenheim 2025-07-13 02:53:53 +02:00
parent cad324cd04
commit cc58735aad
No known key found for this signature in database

View File

@ -157,7 +157,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>, app_status: Res
fn spawn_camera(commands: &mut Commands) { fn spawn_camera(commands: &mut Commands) {
commands commands
.spawn(Camera3d::default()) .spawn(Camera3d::default())
.insert(Transform::from_xyz(0.7, 0.7, -1.0).looking_at(vec3(0.0, 0.3, 0.0), Vec3::Y)); .insert(Transform::from_xyz(-0.7, 0.7, 1.0).looking_at(vec3(0.0, 0.3, 0.0), Vec3::Y));
} }
/// Spawns the scene. /// Spawns the scene.
@ -165,11 +165,14 @@ fn spawn_camera(commands: &mut Commands) {
/// The scene is loaded from a glTF file. /// The scene is loaded from a glTF file.
fn spawn_scene(commands: &mut Commands, asset_server: &AssetServer) { fn spawn_scene(commands: &mut Commands, asset_server: &AssetServer) {
commands commands
.spawn(SceneRoot( .spawn((
asset_server.load( SceneRoot(
GltfAssetLabel::Scene(0) asset_server.load(
.from_asset("models/MixedLightingExample/MixedLightingExample.gltf"), GltfAssetLabel::Scene(0)
.from_asset("models/MixedLightingExample/MixedLightingExample.gltf"),
),
), ),
Transform::default().looking_to(Vec3::Z, Vec3::Y),
)) ))
.observe( .observe(
|_: On<SceneInstanceReady>, |_: On<SceneInstanceReady>,