WIP: Manipulate the assembly #29

Draft
Vectornaut wants to merge 8 commits from tangent-space into main
Showing only changes of commit 2906571f32 - Show all commits

View File

@ -318,16 +318,16 @@ pub fn Display() -> View {
let rep = state.assembly.elements.with_untracked( let rep = state.assembly.elements.with_untracked(
|elts| elts[sel].representation.get_clone_untracked() |elts| elts[sel].representation.get_clone_untracked()
); );
let vel_field_z = DMatrix::from_column_slice(5, 5, &[ let vel_field_x = DMatrix::from_column_slice(5, 5, &[
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
2.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0
]); ]);
let translate_x = translate_pos_x_val - translate_neg_x_val; let translate_x = translate_pos_x_val - translate_neg_x_val;
if translate_x != 0.0 { if translate_x != 0.0 {
let vel = translate_x * vel_field_z * rep; let vel = translate_x * vel_field_x * rep;
let elt_motion: DVector<f64> = time_step * TRANSLATION_SPEED * vel; let elt_motion: DVector<f64> = time_step * TRANSLATION_SPEED * vel;
assembly_for_raf.deform(vec![(sel, elt_motion.as_view())]); assembly_for_raf.deform(vec![(sel, elt_motion.as_view())]);
scene_changed.set(true); scene_changed.set(true);