forked from 1b-agent/opencadstudio-upstream
first commit
This commit is contained in:
1 parent
d52c6440ff
commit
d2fdac7f1e
274 files changed
+89330
No files matched your search
@@ -0,0 +1,22 @@
|
||||
use crate::scene::camera::Camera;
|
||||
use iced::Rectangle;
|
||||
|
||||
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
|
||||
#[repr(C)]
|
||||
pub struct Uniforms {
|
||||
pub view_proj: glam::Mat4,
|
||||
pub camera_pos: glam::Vec4,
|
||||
pub viewport_size: [f32; 2],
|
||||
pub _pad: [f32; 2],
|
||||
}
|
||||
|
||||
impl Uniforms {
|
||||
pub fn new(camera: &Camera, bounds: Rectangle) -> Self {
|
||||
Self {
|
||||
view_proj: camera.view_proj(bounds),
|
||||
camera_pos: camera.position_vec4(),
|
||||
viewport_size: [bounds.width, bounds.height],
|
||||
_pad: [0.0; 2],
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user