From dce6e971023d6c4bc849641c10db5d65ce5fad55 Mon Sep 17 00:00:00 2001 From: mattkae Date: Sun, 9 Jan 2022 20:04:51 -0500 Subject: (mkosarek) Completed simulations for all damped motion --- 2d/softbody/softbody_1.html.content | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to '2d/softbody/softbody_1.html.content') diff --git a/2d/softbody/softbody_1.html.content b/2d/softbody/softbody_1.html.content index bef14d8..c5fb3cc 100644 --- a/2d/softbody/softbody_1.html.content +++ b/2d/softbody/softbody_1.html.content @@ -33,6 +33,7 @@ document.getElementById('damped_spring_length'), document.getElementById('damped_start_position'), document.getElementById('damped_spring_constant'), + document.getElementById('damped_viscous_constant'), document.getElementById('damped_spring_mass') ]); @@ -65,6 +66,7 @@ Damped_SetDisplacement = Module.cwrap('Damped_SetDisplacement', 'void', ['number']), Damped_SetK = Module.cwrap('Damped_SetK', 'void', ['number']), Damped_SetMass = Module.cwrap('Damped_SetMass', 'void', ['number']), + Damped_SetC = Module.cwrap('Damped_SetC', 'void', ['number']), Undamped_lengthSlider = document.getElementById('undamped_spring_length'), Undamped_displacementSlider = document.getElementById('undamped_start_position'), @@ -75,6 +77,7 @@ Damped_displacementSlider = document.getElementById('damped_start_position'), Damped_kSlider = document.getElementById('damped_spring_constant'), Damped_massSlider = document.getElementById('damped_spring_mass'), + Damped_cSlider = document.getElementById('damped_viscous_constant'), undampedSetLength = function(value) { value = Number(value); @@ -118,6 +121,7 @@ Damped_displacementSlider.addEventListener('change', function(event) { Damped_SetDisplacement(Number(event.target.value)); }); Damped_kSlider.addEventListener('change', function(event) { Damped_SetK(Number(event.target.value)); }); Damped_massSlider.addEventListener('change', function(event) { Damped_SetMass(Number(event.target.value)); }); + Damped_cSlider.addEventListener('change', function(event) { Damped_SetC(Number(event.target.value)); }); }; } @@ -181,25 +185,31 @@

- + - + - + + + + + + + - + -- cgit v1.2.1