aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRahiel Kasim <rahiel@protonmail.ch>2015-11-06 01:02:45 +0100
committerRahiel Kasim <rahiel@protonmail.ch>2015-11-06 01:02:45 +0100
commitaa2feb8345ab31d9844c45da17dad8738301c48b (patch)
tree07d4d08aa33c406acbc21a506097acd087532266
parent88cf7fceb5c284dd0256ef32c59fb9635207b662 (diff)
tweak two and three bodies, make Sun default system
-rw-r--r--main.js26
-rw-r--r--systems.js8
-rwxr-xr-xupdate.bash2
3 files changed, 17 insertions, 19 deletions
diff --git a/main.js b/main.js
index 1be7233..74294a4 100644
--- a/main.js
+++ b/main.js
@@ -10,7 +10,7 @@ let requestId = undefined;
import Body from "./systems.js";
import * as systems from "./systems.js";
import * as calc from "./calc.js";
-import * as validate from "./validate.js";
+// import * as validate from "./validate.js";
let bodyTexture = true;
let numBodies = 1;
@@ -36,14 +36,13 @@ let choreoSubmenuList = [
{"label": "YinYang2 ", "function": systems.genYinYang2 , "args": []}
];
-let validationSubmenuList = [
- {"label": "Two Bodies", "function": validate.startTwoBodyValidation, "args": [200]},
- {"label": "Solar System", "function": validate.startSolarSystemValidation, "args": []}
-];
+// let validationSubmenuList = [
+// {"label": "Two Bodies", "function": validate.startTwoBodyValidation, "args": [200]},
+// {"label": "Solar System", "function": validate.startSolarSystemValidation, "args": []}
+// ];
let menuList = [
- {"label": "Empty", "function": systems.genBodies, "args": [0, true, false]},
- {"label": "Only Sun", "function": systems.genBodiesRot, "args": [0, true, true]},
+ {"label": "The Sun", "function": systems.genBodiesRot, "args": [0, true, true]},
{"label": "Two Bodies", "function": systems.gen2Bodies, "args": [true]},
{"label": "Three Bodies", "function": systems.gen3Bodies, "args": [true]},
{"label": "Solar System", "function": systems.genSolarSystem, "args": [true]},
@@ -51,13 +50,11 @@ let menuList = [
{"label": "Angular Momentum", "function": systems.genBodiesRot, "args": [200, "solar", true, false]},
{"label": "Angular with Bounce", "function": systems.genBodiesRot, "args": [200, "balls", true, true, true]},
{"label": "Choreographies", "function": showSubmenu, "args": [choreoSubmenuList]}
- // {"label": "Validate", "function": showSubmenu, "args": [validationSubmenuList]}
];
-
gui(menuList);
-simulate(menuList[0].function, [0, true, false]);
+simulate(menuList[0].function, menuList[0].args);
function gui(buttonList) {
let buttonHeight = 50;
@@ -169,10 +166,11 @@ function showSubmenu(submenuList) {
.on("click", function(d){
d3.selectAll(".subButton.selected")
.classed("selected", false);
- if (d["function"] == validate.startTwoBodyValidation || d["function"] == validate.startSolarSystemValidation){
- d["function"](...d["args"]);
+ // if (d["function"] == validate.startTwoBodyValidation || d["function"] == validate.startSolarSystemValidation){
+ // d["function"](...d["args"]);
- }
+ // }
+ if (false) {}
else{
clearSimulation();
simulate(d.function, d.args);
@@ -267,7 +265,7 @@ function init() {
if (system.sunOn) {
let sun = spheres[0];
sun.material.emissive.set(0xCAAA33);
- sun.material.emissiveMap = sun.material.map
+ sun.material.emissiveMap = sun.material.map;
// sunlight
let light = new THREE.PointLight(0xfcd440, 2, 8000);
diff --git a/systems.js b/systems.js
index 82c5225..7c8d011 100644
--- a/systems.js
+++ b/systems.js
@@ -188,8 +188,8 @@ export function gen2Bodies(sunOn) {
return {
bodies: bodies,
- stepsize: 0.0000005,
- stepsPerFrame: 1000,
+ stepsize: 0.000005,
+ stepsPerFrame: 300,
camera: {x: 0, y: 0, z: 250},
collisions: false,
sunOn: sunOn,
@@ -206,8 +206,8 @@ export function gen3Bodies(sunOn) {
return {
bodies: bodies,
- stepsize: 0.0000003,
- stepsPerFrame: 1000,
+ stepsize: 0.000003,
+ stepsPerFrame: 300,
camera: {x: 0, y: 0, z: 250},
collisions: false,
sunOn: sunOn,
diff --git a/update.bash b/update.bash
index 768cfbc..92596f0 100755
--- a/update.bash
+++ b/update.bash
@@ -4,7 +4,7 @@ path="sunsistemo.github.io/"
cp index.html "$path"
cp style.css "$path"
cp -r textures/ "$path"
-cp -r lib/ "$path"
+cp validation/index.html "$path"/validation/
webpack --optimize-minimize --output-path "$path"
cd "$path"
git mv CNAME CNAME-disabled