use glam::{Affine2, Vec2};
use crate::data::runtime::mesh::MeshIdx;
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum PayloadUsage {
Mesh(MeshIdx),
ClipStart { id: MeshIdx },
ClipEnd { id: MeshIdx },
}
#[non_exhaustive]
#[derive(Debug, Clone)]
pub struct MeshPayload {
pub usage: PayloadUsage,
pub slot: crate::data::runtime::slot::SlotIdx,
pub uvs: Vec<Vec2>,
pub positions: Vec<Vec2>,
pub indices: Vec<u32>,
pub tint_color: [f32; 4],
pub uv_transform: Affine2,
}
impl MeshPayload {
pub fn new(
usage: PayloadUsage,
slot: crate::data::runtime::slot::SlotIdx,
positions: Vec<Vec2>,
uvs: Vec<Vec2>,
indices: Vec<u32>,
tint_color: [f32; 4],
uv_transform: Affine2,
) -> Self {
Self {
usage,
slot,
positions,
uvs,
indices,
tint_color,
uv_transform,
}
}
}