Correct the translation direction
Make the x translation keys translate along the x axis, as intended.
This commit is contained in:
parent
58e7587131
commit
2906571f32
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user