moc3/v3_00_00/model/
warp_deformer.rs1use super::offsets::WarpDeformerOffsets;
2use crate::prelude::*;
3
4#[derive(Debug, Clone, Copy, Default, PartialEq, PartialOrd)]
5pub struct WarpDeformer {
6 pub keyform_binding_sources_index: i32,
7 pub keyform_sources_begin_index: i32,
8 pub keyform_sources_count: i32,
9 pub vertex_count: i32,
10 pub rows: u32,
11 pub columns: u32,
12}
13
14impl ExtractFromOffsets for WarpDeformer {
15 type Offsets = WarpDeformerOffsets;
16
17 fn extract_one(index: u64, offsets: &Self::Offsets, moc3: &mut Reader) -> Result<Self> {
18 Ok(Self {
19 keyform_binding_sources_index: moc3.read_one_at_offset_with_index(offsets.keyform_binding_sources_indices, index)?,
20 keyform_sources_begin_index: moc3.read_one_at_offset_with_index(offsets.keyform_sources_begin_indices, index)?,
21 keyform_sources_count: moc3.read_one_at_offset_with_index(offsets.keyform_sources_counts, index)?,
22 vertex_count: moc3.read_one_at_offset_with_index(offsets.vertex_counts, index)?,
23 rows: moc3.read_one_at_offset_with_index(offsets.rows, index)?,
24 columns: moc3.read_one_at_offset_with_index(offsets.columns, index)?,
25 })
26 }
27}