Skip to content

Commit

Permalink
Merge pull request #19 from Magic-zhu/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili authored Jun 17, 2024
2 parents beab085 + e0071b4 commit 0ce1036
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/intermediate/tutorial12-camera/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,19 @@ mod camera; // 新增!

```rust

struct CameraUniform {
view_position: [f32; 4],
view_proj: [[f32; 4]; 4],
}

impl CameraUniform {
// ...

fn new() -> Self {
Self {
view_position: [0.0; 4],
view_proj: glam::Mat4::IDENTITY.to_cols_array_2d(),
}
}

// 更新!
fn update_view_proj(&mut self, camera: &camera::Camera, projection: &camera::Projection) {
Expand Down

0 comments on commit 0ce1036

Please sign in to comment.