Skip to content

Commit

Permalink
Change scaling mode to FixedHorizontal
Browse files Browse the repository at this point in the history
  • Loading branch information
kirusfg committed Mar 22, 2022
1 parent 024d984 commit 9ca3718
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ use bevy_pbr::{
};
use bevy_render::{
camera::{
Camera, Camera2d, Camera3d, CameraProjection, OrthographicProjection, PerspectiveProjection,
Camera, Camera2d, Camera3d, CameraProjection, OrthographicProjection,
PerspectiveProjection, ScalingMode,
},
color::Color,
mesh::{Indices, Mesh, VertexAttributeValues},
Expand Down Expand Up @@ -612,14 +613,19 @@ fn load_node(
bottom: -ymag,
far: orthographic.zfar(),
near: orthographic.znear(),
scaling_mode: ScalingMode::FixedHorizontal,
scale: xmag,
..Default::default()
};

node.insert(Camera {
projection_matrix: orthographic_projection.get_projection_matrix(),
near: orthographic_projection.near,
far: orthographic_projection.far,
..Default::default()
});
node.insert(orthographic_projection).insert(Camera2d);
node.insert(orthographic_projection);
node.insert(Camera3d);
}
gltf::camera::Projection::Perspective(perspective) => {
let mut perspective_projection: PerspectiveProjection = PerspectiveProjection {
Expand Down

0 comments on commit 9ca3718

Please sign in to comment.