MCPcopy Create free account
hub / github.com/PerroEngine/Perro / select_animation

Function select_animation

perro_source/devtools/perro_cli/src/gltf_animation.rs:187–201  ·  view source on GitHub ↗
(
    doc: &'a gltf::Document,
    clip_selector: Option<&str>,
)

Source from the content-addressed store, hash-verified

185 {
186 gltf::animation::util::ReadOutputs::Translations(values) => {
187 let values = values.collect::<Vec<_>>();
188 for (index, time) in inputs.iter().copied().enumerate() {
189 let Some(value) = values.get(index * value_step + value_offset).copied() else {
190 continue;
191 };
192 insert_track(&mut frames, time, fps, &object, &prop, vec3_value(value));
193 }
194 }
195 gltf::animation::util::ReadOutputs::Rotations(values) => {
196 let values = values.into_f32().collect::<Vec<_>>();
197 for (index, time) in inputs.iter().copied().enumerate() {
198 let Some(mut value) = values.get(index * value_step + value_offset).copied()
199 else {
200 continue;
201 };
202 if let Some(rest) = source_rest_by_node.get(&node_index) {
203 value = rotation_to_pose_delta(rest.rotation, value);
204 }

Callers 1

Calls 2

findMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected