use crate::handler::IndexBuffer;
use crate::unpack::VertexArray;
use crate::vertex::Attributes;
#[derive(Debug)]
pub struct ProcessedOwned {
pub(crate) vertex_count: u64,
pub(crate) use_16bit: bool,
pub(crate) index_buffer: Option<IndexBuffer>,
pub(crate) attrs: Attributes,
}
const _: () = crate::send_sync::<ProcessedOwned>();
impl ProcessedOwned {
#[must_use]
pub fn vertex_count(&self) -> u64 {
self.vertex_count
}
#[must_use]
pub fn use_16bit_indices(&self) -> bool {
self.use_16bit
}
#[must_use]
pub fn index_buffer(&self) -> Option<&IndexBuffer> {
self.index_buffer.as_ref()
}
#[must_use]
pub fn vertices(&self) -> Option<&VertexArray> {
self.attrs.vertices.as_ref()
}
#[must_use]
pub fn normals(&self) -> Option<&VertexArray> {
self.attrs.normals.as_ref()
}
#[must_use]
pub fn tangents(&self) -> Option<&VertexArray> {
self.attrs.tangents.as_ref()
}
#[must_use]
pub fn colors(&self) -> Option<&VertexArray> {
self.attrs.colors.as_ref()
}
#[must_use]
pub fn uv(&self, i: usize) -> Option<&VertexArray> {
self.attrs.uv.get(i).and_then(Option::as_ref)
}
#[must_use]
pub fn bone_weights(&self) -> Option<&VertexArray> {
self.attrs.bone_weights.as_ref()
}
#[must_use]
pub fn bone_indices(&self) -> Option<&VertexArray> {
self.attrs.bone_indices.as_ref()
}
#[must_use]
pub fn bind_pose(&self) -> Option<&VertexArray> {
self.attrs.bind_pose.as_ref()
}
}