Skip to content

Commit

Permalink
补全省略部分, 从基础相机部分直接跳过来看时更好发现CameraUniform的结构变化
Browse files Browse the repository at this point in the history
  • Loading branch information
Magic-zhu committed Jun 17, 2024
1 parent beab085 commit e0071b4
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 e0071b4

Please sign in to comment.