use super::*;
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct RtTriangle {
#[get(type(copy))]
pub(crate) v0: Vec3,
#[get(type(copy))]
pub(crate) edge1: Vec3,
#[get(type(copy))]
pub(crate) edge2: Vec3,
#[get(type(copy))]
pub(crate) n0: Vec3,
#[get(type(copy))]
pub(crate) n1: Vec3,
#[get(type(copy))]
pub(crate) n2: Vec3,
#[get(type(copy))]
pub(crate) uv0: Vec2,
#[get(type(copy))]
pub(crate) uv1: Vec2,
#[get(type(copy))]
pub(crate) uv2: Vec2,
#[get(type(copy))]
pub(crate) geometric_normal: Vec3,
#[get(type(copy))]
pub(crate) bounds: AxisAlignedBox3D,
#[get(type(copy))]
pub(crate) centroid: Vec3,
#[get(type(copy))]
pub(crate) material_slot: u16,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct BlasNode3D {
#[get(type(copy))]
pub(crate) bounds: AxisAlignedBox3D,
#[get(type(copy))]
pub(crate) left: u32,
#[get(type(copy))]
pub(crate) right: u32,
#[get(type(copy))]
pub(crate) first_tri: u32,
#[get(type(copy))]
pub(crate) tri_count: u32,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct Blas3D {
pub(crate) nodes: Vec<BlasNode3D>,
pub(crate) triangles: Vec<RtTriangle>,
#[get(type(copy))]
pub(crate) bounds: AxisAlignedBox3D,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct RtLocalHit {
#[get(type(copy))]
pub(crate) distance: f32,
#[get(type(copy))]
pub(crate) barycentric_u: f32,
#[get(type(copy))]
pub(crate) barycentric_v: f32,
#[get(type(copy))]
pub(crate) position: Vec3,
#[get(type(copy))]
pub(crate) geometric_normal: Vec3,
#[get(type(copy))]
pub(crate) shading_normal: Vec3,
#[get(type(copy))]
pub(crate) uv: Vec2,
#[get(type(copy))]
pub(crate) triangle_index: u32,
#[get(type(copy))]
pub(crate) material_slot: u16,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct RtInstance {
#[get(type(copy))]
pub(crate) blas_id: u32,
#[get(type(copy))]
pub(crate) transform: Mat4,
#[get(type(copy))]
pub(crate) inv_transform: Mat4,
#[get(type(copy))]
pub(crate) normal_matrix: [Vec3; 3],
#[get(type(copy))]
pub(crate) material_id: u32,
#[get(type(copy))]
pub(crate) world_bounds: AxisAlignedBox3D,
#[get(type(copy))]
pub(crate) visible: bool,
#[get(type(copy))]
pub(crate) determinant_sign: f32,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct TlasNode3D {
#[get(type(copy))]
pub(crate) bounds: AxisAlignedBox3D,
#[get(type(copy))]
pub(crate) left: u32,
#[get(type(copy))]
pub(crate) right: u32,
#[get(type(copy))]
pub(crate) first_instance: u32,
#[get(type(copy))]
pub(crate) instance_count: u32,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct Tlas3D {
pub(crate) nodes: Vec<TlasNode3D>,
pub(crate) instances: Vec<RtInstance>,
pub(crate) instance_order: Vec<u32>,
#[get(type(copy))]
pub(crate) bounds: AxisAlignedBox3D,
#[get(type(copy))]
pub(crate) refit_count: u64,
#[get(type(copy))]
pub(crate) rebuild_count: u64,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct RtHit {
#[get(type(copy))]
pub(crate) distance: f32,
#[get(type(copy))]
pub(crate) point: Vec3,
#[get(type(copy))]
pub(crate) geometric_normal: Vec3,
#[get(type(copy))]
pub(crate) shading_normal: Vec3,
#[get(type(copy))]
pub(crate) uv: Vec2,
#[get(type(copy))]
pub(crate) material_id: u32,
#[get(type(copy))]
pub(crate) instance_id: u32,
#[get(type(copy))]
pub(crate) primitive_index: u32,
#[get(type(copy))]
pub(crate) front_face: bool,
}
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct RtPrimitive {
#[get(type(copy))]
pub(crate) shape: RtPrimitiveShape,
#[get(type(copy))]
pub(crate) material_id: u32,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct SdfSphereTracer {
pub(crate) ops: Vec<RtSdfOp>,
#[get(type(copy))]
pub(crate) root_index: u32,
#[get(type(copy))]
pub(crate) material_id: u32,
#[get(type(copy))]
pub(crate) bounds: AxisAlignedBox3D,
#[get(type(copy))]
pub(crate) max_steps: u32,
#[get(type(copy))]
pub(crate) hit_epsilon: f32,
#[get(type(copy))]
pub(crate) normal_epsilon: f32,
#[get(type(copy))]
pub(crate) max_distance: f32,
#[get(type(copy))]
pub(crate) lipschitz_factor: f32,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub(crate) struct SahBin {
#[get(type(copy))]
pub(crate) bounds: AxisAlignedBox3D,
#[get(type(copy))]
pub(crate) count: u32,
}