Commit 438e1bc8 authored by amandaghassaei's avatar amandaghassaei
Browse files

cleaning up

parent aed802b3
...@@ -307,17 +307,23 @@ ...@@ -307,17 +307,23 @@
float triangleStiffness = 0.1; float triangleStiffness = 0.1;
anglesDiff *= triangleStiffness; anglesDiff *= triangleStiffness;
if (faceIndex == 0){//a if (faceIndex == 0){//a
force -= anglesDiff[0]*(cross(normal, ac)/lengthAC - cross(normal, ab)/lengthAB); vec3 normalCrossAC = cross(normal, ac)/lengthAC;
force += anglesDiff[1]*cross(normal, -ab)/lengthAB; vec3 normalCrossAB = cross(normal, ab)/lengthAB;
force -= anglesDiff[2]*cross(normal, -ac)/lengthAC; force -= anglesDiff[0]*(normalCrossAC - normalCrossAB);
force -= anglesDiff[1]*normalCrossAB;
force += anglesDiff[2]*normalCrossAC;
} else if (faceIndex == 1){ } else if (faceIndex == 1){
force -= anglesDiff[0]*cross(normal, ab)/lengthAB; vec3 normalCrossAB = cross(normal, ab)/lengthAB;
force -= anglesDiff[1]*(cross(normal, -ab)/lengthAB - cross(normal, bc)/lengthBC); vec3 normalCrossBC = cross(normal, bc)/lengthBC;
force += anglesDiff[2]*cross(normal, -bc)/lengthBC; force -= anglesDiff[0]*normalCrossAB;
force += anglesDiff[1]*(normalCrossAB + normalCrossBC);
force -= anglesDiff[2]*normalCrossBC;
} else if (faceIndex == 2){ } else if (faceIndex == 2){
force += anglesDiff[0]*cross(normal, ac)/lengthAC; vec3 normalCrossAC = cross(normal, ac)/lengthAC;
force -= anglesDiff[1]*cross(normal, bc)/lengthBC; vec3 normalCrossBC = cross(normal, bc)/lengthBC;
force -= anglesDiff[2]*(cross(normal, -bc)/lengthBC - cross(normal, -ac)/lengthAC); force += anglesDiff[0]*normalCrossAC;
force -= anglesDiff[1]*normalCrossBC;
force += anglesDiff[2]*(normalCrossBC - normalCrossAC);
} }
} }
...@@ -668,10 +674,10 @@ ...@@ -668,10 +674,10 @@
<span class="label-slider">Axial Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div> <span class="label-slider">Axial Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div>
<input value="" placeholder="" class="form-control" type="text"> <input value="" placeholder="" class="form-control" type="text">
</div> </div>
<div class="sliderInput paddingBottom" id="triStiffness"> <!--<div class="sliderInput paddingBottom" id="triStiffness">-->
<span class="label-slider">Triangle Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div> <!--<span class="label-slider">Triangle Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div>-->
<input value="" placeholder="" class="form-control" type="text"> <!--<input value="" placeholder="" class="form-control" type="text">-->
</div> <!--</div>-->
<div class="sliderInput" id="creaseStiffness"> <div class="sliderInput" id="creaseStiffness">
<span class="label-slider">Fold Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div> <span class="label-slider">Fold Strength : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div>
<input value="" placeholder="" class="form-control" type="text"> <input value="" placeholder="" class="form-control" type="text">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment