unityrs_meshdecode/
owned.rs1use crate::handler::IndexBuffer;
3use crate::unpack::VertexArray;
4use crate::vertex::Attributes;
5
6#[derive(Debug)]
8pub struct ProcessedOwned {
9 pub(crate) vertex_count: u64,
10 pub(crate) use_16bit: bool,
11 pub(crate) index_buffer: Option<IndexBuffer>,
12 pub(crate) attrs: Attributes,
13}
14const _: () = crate::send_sync::<ProcessedOwned>();
15impl ProcessedOwned {
16 #[must_use]
18 pub fn vertex_count(&self) -> u64 {
19 self.vertex_count
20 }
21
22 #[must_use]
24 pub fn use_16bit_indices(&self) -> bool {
25 self.use_16bit
26 }
27
28 #[must_use]
30 pub fn index_buffer(&self) -> Option<&IndexBuffer> {
31 self.index_buffer.as_ref()
32 }
33
34 #[must_use]
36 pub fn vertices(&self) -> Option<&VertexArray> {
37 self.attrs.vertices.as_ref()
38 }
39
40 #[must_use]
42 pub fn normals(&self) -> Option<&VertexArray> {
43 self.attrs.normals.as_ref()
44 }
45
46 #[must_use]
48 pub fn tangents(&self) -> Option<&VertexArray> {
49 self.attrs.tangents.as_ref()
50 }
51
52 #[must_use]
54 pub fn colors(&self) -> Option<&VertexArray> {
55 self.attrs.colors.as_ref()
56 }
57
58 #[must_use]
60 pub fn uv(&self, i: usize) -> Option<&VertexArray> {
61 self.attrs.uv.get(i).and_then(Option::as_ref)
62 }
63
64 #[must_use]
66 pub fn bone_weights(&self) -> Option<&VertexArray> {
67 self.attrs.bone_weights.as_ref()
68 }
69
70 #[must_use]
72 pub fn bone_indices(&self) -> Option<&VertexArray> {
73 self.attrs.bone_indices.as_ref()
74 }
75
76 #[must_use]
82 pub fn bind_pose(&self) -> Option<&VertexArray> {
83 self.attrs.bind_pose.as_ref()
84 }
85}