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 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to '2d/softbody/softbody_1.html') diff --git a/2d/softbody/softbody_1.html b/2d/softbody/softbody_1.html index 3f0fc40..ae4b743 100644 --- a/2d/softbody/softbody_1.html +++ b/2d/softbody/softbody_1.html @@ -86,6 +86,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') ]); @@ -118,6 +119,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'), @@ -128,6 +130,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); @@ -171,6 +174,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)); }); }; } @@ -234,25 +238,31 @@

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