//! Traits for describing Cyborg's scene representation. //! //! TODO this will all need to be replaced in favor of a way to represent //! querying component and resource data framework-agnostically use crate::storage::mesh::MeshHandle; use parking_lot::RwLock; use std::sync::Arc; pub struct TransformedMesh { pub transform: glam::Mat4, pub mesh: MeshHandle, } #[derive(Default)] pub struct Meshes { pub transformed: Vec, } pub type MeshesHandle = Arc>; #[repr(C)] #[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] pub struct DebugVertex { pub position: [f32; 3], pub color: [f32; 3], } pub const DEBUG_VERTEX_ATTRS: &[wgpu::VertexAttribute] = &wgpu::vertex_attr_array![0 => Float32x3, 1 => Float32x3]; impl DebugVertex { pub fn desc() -> wgpu::VertexBufferLayout<'static> { wgpu::VertexBufferLayout { array_stride: std::mem::size_of::() as wgpu::BufferAddress, step_mode: wgpu::VertexStepMode::Vertex, attributes: DEBUG_VERTEX_ATTRS, } } } pub type DebugIndex = u32; pub struct DebugDraw { pub vertices: Vec, pub indices: Vec, } #[derive(Default)] pub struct DebugDraws { pub draws: Vec, } pub type DebugDrawsHandle = Arc>;