pub struct PayloadMorphs {
pub names: Vec<String>,
pub offsets: Vec<u32>,
pub entries: Vec<MorphEntry>,
}Expand description
Morph-target block of a skinned payload: target names plus the sparse vertex-major entries.
Fields§
§names: Vec<String>Morph-target names, in target order.
offsets: Vec<u32>vertex_count + 1 entry offsets; vertex v owns
entries[offsets[v]..offsets[v + 1]]. Empty when there are no targets.
entries: Vec<MorphEntry>Sparse entries, grouped by vertex, targets ascending within a vertex.
Implementations§
Source§impl PayloadMorphs
impl PayloadMorphs
Sourcepub fn target_count(&self) -> usize
pub fn target_count(&self) -> usize
Morph targets on the mesh.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Vertices the offsets table covers (0 without targets).
Sourcepub fn from_dense(
names: Vec<String>,
vertex_count: usize,
deltas: &[MorphDelta],
) -> Result<PayloadMorphs, String>
pub fn from_dense( names: Vec<String>, vertex_count: usize, deltas: &[MorphDelta], ) -> Result<PayloadMorphs, String>
Build the sparse block from dense target-major deltas
(deltas[t * vertex_count + v]), keeping every delta with a component
above MORPH_DELTA_EPSILON.
Sourcepub fn to_dense(&self) -> Vec<MorphDelta>
pub fn to_dense(&self) -> Vec<MorphDelta>
Expand back to dense target-major deltas ([t * vertex_count + v]),
with zeros wherever no entry exists.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Check the tables agree: offsets start at 0, never decrease, end at the entry count, and every entry names a declared target.
Sourcepub fn packed_words(&self) -> Vec<u32>
pub fn packed_words(&self) -> Vec<u32>
The single GPU buffer the deform kernels read: the offsets table, then
the entries, which start at the first 16-byte-aligned word past it.
Each entry is seven 4-byte words laid out as MorphEntry.
Trait Implementations§
Source§impl Clone for PayloadMorphs
impl Clone for PayloadMorphs
Source§fn clone(&self) -> PayloadMorphs
fn clone(&self) -> PayloadMorphs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more