Skip to content

Commit

Permalink
Fix glTF perspective camera projection (bevyengine#4006)
Browse files Browse the repository at this point in the history
# Objective

- Fixes bevyengine#4005 

## Solution

- Include the `near` and `far` clipping values from the perspective projection in the `Camera` struct; before that, they were both being defaulted to 0.
  • Loading branch information
kirusfg authored and Ku95 committed Mar 6, 2022
1 parent 65f1da2 commit d986ae8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ fn load_node(
node.insert(Camera {
name: Some(CameraPlugin::CAMERA_3D.to_owned()),
projection_matrix: perspective_projection.get_projection_matrix(),
near: perspective_projection.near,
far: perspective_projection.far,
..Default::default()
});
node.insert(perspective_projection);
Expand Down

0 comments on commit d986ae8

Please sign in to comment.