diff --git a/controllers/bouncing/views/index.jade b/controllers/bouncing/views/index.jade index 454cd92..02bebde 100644 --- a/controllers/bouncing/views/index.jade +++ b/controllers/bouncing/views/index.jade @@ -1,9 +1,11 @@ -extends ../../../views/withjs +extends ../../../views/main block title title #{title} - Bouncing cube block extrajs - script(src="/static/js/bouncing/BouncingMain.js") + script(src="/static/js/three.min.js") + script(src="/static/js/threetools.min.js") + script(src="/static/js/bouncing.min.js") block content h2 Bouncing cube diff --git a/controllers/multisphere/views/index.jade b/controllers/multisphere/views/index.jade index d305464..c1189c6 100644 --- a/controllers/multisphere/views/index.jade +++ b/controllers/multisphere/views/index.jade @@ -1,10 +1,12 @@ -extends ../../../views/withjs +extends ../../../views/main.jade block title title #{title} - Multi-sphere block extrajs - script(src="/static/js/multisphere/MultiSphere.js") + script(src="/static/js/three.min.js") + script(src="/static/js/threetools.min.js") + script(src="/static/js/multisphere.min.js") block content h2 Multiresolution sphere diff --git a/controllers/prototype/views/prototype.jade b/controllers/prototype/views/prototype.jade index fb82db6..6a53f9f 100644 --- a/controllers/prototype/views/prototype.jade +++ b/controllers/prototype/views/prototype.jade @@ -4,17 +4,7 @@ block title title #{title} - Prototype block extrajs - script(src="/static/js/prototype/ArrowCamera.js") - script(src="/static/js/prototype/FixedCamera.js") - script(src="/static/js/prototype/OldFixedCamera.js") - script(src="/static/js/prototype/ReverseCamera.js") - script(src="/static/js/prototype/initScene.js") - script(src="/static/js/prototype/raycasterTools.js") - script(src="/static/js/prototype/Previewer.js") - script(src="/static/js/prototype/ButtonManager.js") - script(src="/static/js/prototype/Coin.js") - script(src="/static/js/Logger.js") - + script(src="/static/js/prototypetools.min.js") block configjs block mainjs script document.getElementById('music').volume = 0.5; diff --git a/controllers/prototype/views/prototype_interactive.jade b/controllers/prototype/views/prototype_interactive.jade index 69f4315..24fd196 100644 --- a/controllers/prototype/views/prototype_interactive.jade +++ b/controllers/prototype/views/prototype_interactive.jade @@ -4,7 +4,7 @@ block title title #{title} - Prototype block mainjs - script(src="/static/js/prototype/main.js") + script(src="/static/js/prototypeinteractive.min.js") block description #instructions.panel.panel-default diff --git a/controllers/prototype/views/prototype_replays.jade b/controllers/prototype/views/prototype_replays.jade index ba28af7..4a9fc92 100644 --- a/controllers/prototype/views/prototype_replays.jade +++ b/controllers/prototype/views/prototype_replays.jade @@ -6,7 +6,6 @@ block title block configjs script RecommendedCamera = FixedCamera; script var params = params || {}; params.get = params.get || {}; params.get.id = #{id}; - script(src="/static/js/ReplayCamera.js") block mainjs - script(src="/static/js/prototype/replay.js") + script(src="/static/js/replay.min.js") diff --git a/controllers/stream/views/index.jade b/controllers/stream/views/index.jade index b8e5cc9..1927eda 100644 --- a/controllers/stream/views/index.jade +++ b/controllers/stream/views/index.jade @@ -1,11 +1,13 @@ -extends ../../../views/withjs +extends ../../../views/main block title title #{title} - Streaming simulator block extrajs script params = {}; params.get= {}; params.get.res = #{resolution} - script(src="/static/js/stream/main.js") + script(src="/static/js/three.min.js") + script(src="/static/js/threetools.min.js") + script(src="/static/js/streamingsimulator.min.js") block content h2 Streaming simulator diff --git a/static/js/BouncingCube.js b/js/BouncingCube.js similarity index 100% rename from static/js/BouncingCube.js rename to js/BouncingCube.js diff --git a/static/js/BufferGeometryToGeometry.js b/js/BufferGeometryToGeometry.js similarity index 100% rename from static/js/BufferGeometryToGeometry.js rename to js/BufferGeometryToGeometry.js diff --git a/static/js/Camera.js b/js/Camera.js similarity index 100% rename from static/js/Camera.js rename to js/Camera.js diff --git a/static/js/CameraContainer.js b/js/CameraContainer.js similarity index 100% rename from static/js/CameraContainer.js rename to js/CameraContainer.js diff --git a/static/js/Cube.js b/js/Cube.js similarity index 100% rename from static/js/Cube.js rename to js/Cube.js diff --git a/static/js/Hermite.js b/js/Hermite.js similarity index 100% rename from static/js/Hermite.js rename to js/Hermite.js diff --git a/static/js/HermiteTest/HermiteTest.js b/js/HermiteTest/HermiteTest.js similarity index 100% rename from static/js/HermiteTest/HermiteTest.js rename to js/HermiteTest/HermiteTest.js diff --git a/static/js/Logger.js b/js/Logger.js similarity index 100% rename from static/js/Logger.js rename to js/Logger.js diff --git a/js/Makefile b/js/Makefile new file mode 100644 index 0000000..e9b3f56 --- /dev/null +++ b/js/Makefile @@ -0,0 +1,78 @@ +OPT=--compilation_level SIMPLE_OPTIMIZATIONS +CLOSURE=java -jar /usr/share/java/closure-compiler/closure-compiler.jar + +all: Three Stats ThreeTools Bouncing Multisphere StreamingSimulator PrototypeTools PrototypeReplay PrototypeInteractive + +Three: + cp three/three.min.js ../static/js/ + +Stats: + cp three/stats.min.js ../static/js/ + +ThreeTools: + $(CLOSURE) $(OPT) \ + --js three/DDSLoader.js \ + --js three/MTLLoader.js \ + --js three/OBJMTLLoader.js \ + --js three/OBJLoader.js \ + --js three/OrbitControls.js \ + --js Tools.js \ + --js_output_file ../static/js/threetools.min.js + +Bouncing: + $(CLOSURE) $(OPT) \ + --js Camera.js \ + --js Cube.js \ + --js BouncingCube.js \ + --js bouncing/BouncingMain.js \ + --js_output_file ../static/js/bouncing.min.js + +Multisphere: + $(CLOSURE) $(OPT) \ + --js StaticPath.js \ + --js Camera.js \ + --js Cube.js \ + --js multisphere/MultiSphere.js \ + --js_output_file ../static/js/multisphere.min.js + +StreamingSimulator: + $(CLOSURE) $(OPT) \ + --js StaticPath.js \ + --js Camera.js \ + --js Cube.js \ + --js ProgressiveSphere.js \ + --js stream/main.js \ + --js_output_file ../static/js/streamingsimulator.min.js + +PrototypeTools: + $(CLOSURE) $(OPT) \ + --js StaticPath.js \ + --js Hermite.js \ + --js Camera.js \ + --js PointerCamera.js \ + --js CameraContainer.js \ + --js prototype/ArrowCamera.js \ + --js prototype/FixedCamera.js \ + --js prototype/OldFixedCamera.js \ + --js prototype/ReverseCamera.js \ + --js prototype/ReplayCamera.js \ + --js prototype/initScene.js \ + --js prototype/raycasterTools.js \ + --js prototype/Previewer.js \ + --js prototype/ButtonManager.js \ + --js prototype/Coin.js \ + --js Logger.js \ + --js_output_file ../static/js/prototypetools.min.js + +PrototypeInteractive: + $(CLOSURE) $(OPT) \ + --js prototype/main.js \ + --js_output_file ../static/js/prototypeinteractive.min.js + +PrototypeReplay: + $(CLOSURE) $(OPT) \ + --js prototype/replay.js \ + --js_output_file ../static/js/replay.min.js + +clean: + rm -ri ../static/js/* diff --git a/static/js/PointerCamera.js b/js/PointerCamera.js similarity index 99% rename from static/js/PointerCamera.js rename to js/PointerCamera.js index efbcc6c..d6d4fce 100644 --- a/static/js/PointerCamera.js +++ b/js/PointerCamera.js @@ -179,7 +179,6 @@ PointerCamera.prototype.vectorsFromAngles = function() { } PointerCamera.prototype.anglesFromVectors = function() { - // Update phi and theta so that return to reality does not hurt var forward = Tools.diff(this.target, this.position); forward.normalize(); diff --git a/static/js/ProgressiveSphere.js b/js/ProgressiveSphere.js similarity index 100% rename from static/js/ProgressiveSphere.js rename to js/ProgressiveSphere.js diff --git a/js/StaticPath.js b/js/StaticPath.js new file mode 100644 index 0000000..2f1be91 --- /dev/null +++ b/js/StaticPath.js @@ -0,0 +1 @@ +static_path = "/static/"; diff --git a/static/js/Tools.js b/js/Tools.js similarity index 100% rename from static/js/Tools.js rename to js/Tools.js diff --git a/static/js/ToolsTest.js b/js/ToolsTest.js similarity index 100% rename from static/js/ToolsTest.js rename to js/ToolsTest.js diff --git a/static/js/bouncing/BouncingMain.js b/js/bouncing/BouncingMain.js similarity index 100% rename from static/js/bouncing/BouncingMain.js rename to js/bouncing/BouncingMain.js diff --git a/static/js/multisphere/MultiSphere.js b/js/multisphere/MultiSphere.js similarity index 100% rename from static/js/multisphere/MultiSphere.js rename to js/multisphere/MultiSphere.js diff --git a/static/js/prototype/ArrowCamera.js b/js/prototype/ArrowCamera.js similarity index 100% rename from static/js/prototype/ArrowCamera.js rename to js/prototype/ArrowCamera.js diff --git a/static/js/prototype/ButtonManager.js b/js/prototype/ButtonManager.js similarity index 100% rename from static/js/prototype/ButtonManager.js rename to js/prototype/ButtonManager.js diff --git a/static/js/prototype/Coin.js b/js/prototype/Coin.js similarity index 100% rename from static/js/prototype/Coin.js rename to js/prototype/Coin.js diff --git a/static/js/prototype/FixedCamera.js b/js/prototype/FixedCamera.js similarity index 100% rename from static/js/prototype/FixedCamera.js rename to js/prototype/FixedCamera.js diff --git a/static/js/prototype/OldFixedCamera.js b/js/prototype/OldFixedCamera.js similarity index 100% rename from static/js/prototype/OldFixedCamera.js rename to js/prototype/OldFixedCamera.js diff --git a/static/js/prototype/Previewer.js b/js/prototype/Previewer.js similarity index 100% rename from static/js/prototype/Previewer.js rename to js/prototype/Previewer.js diff --git a/static/js/ReplayCamera.js b/js/prototype/ReplayCamera.js similarity index 100% rename from static/js/ReplayCamera.js rename to js/prototype/ReplayCamera.js diff --git a/static/js/prototype/ReverseCamera.js b/js/prototype/ReverseCamera.js similarity index 100% rename from static/js/prototype/ReverseCamera.js rename to js/prototype/ReverseCamera.js diff --git a/static/js/prototype/initScene.js b/js/prototype/initScene.js similarity index 100% rename from static/js/prototype/initScene.js rename to js/prototype/initScene.js diff --git a/static/js/prototype/main.js b/js/prototype/main.js similarity index 100% rename from static/js/prototype/main.js rename to js/prototype/main.js diff --git a/static/js/prototype/raycasterTools.js b/js/prototype/raycasterTools.js similarity index 100% rename from static/js/prototype/raycasterTools.js rename to js/prototype/raycasterTools.js diff --git a/static/js/prototype/replay.js b/js/prototype/replay.js similarity index 100% rename from static/js/prototype/replay.js rename to js/prototype/replay.js diff --git a/static/js/stream/main.js b/js/stream/main.js similarity index 100% rename from static/js/stream/main.js rename to js/stream/main.js diff --git a/static/js/three.js b/js/three.js similarity index 100% rename from static/js/three.js rename to js/three.js diff --git a/static/js/three/DDSLoader.js b/js/three/DDSLoader.js similarity index 100% rename from static/js/three/DDSLoader.js rename to js/three/DDSLoader.js diff --git a/static/js/three/MTLLoader.js b/js/three/MTLLoader.js similarity index 100% rename from static/js/three/MTLLoader.js rename to js/three/MTLLoader.js diff --git a/static/js/three/OBJLoader.js b/js/three/OBJLoader.js similarity index 100% rename from static/js/three/OBJLoader.js rename to js/three/OBJLoader.js diff --git a/static/js/three/OBJMTLLoader.js b/js/three/OBJMTLLoader.js similarity index 100% rename from static/js/three/OBJMTLLoader.js rename to js/three/OBJMTLLoader.js diff --git a/static/js/three/OrbitControls.js b/js/three/OrbitControls.js similarity index 100% rename from static/js/three/OrbitControls.js rename to js/three/OrbitControls.js diff --git a/static/js/three/stats.min.js b/js/three/stats.min.js similarity index 100% rename from static/js/three/stats.min.js rename to js/three/stats.min.js diff --git a/static/js/three/three.min.js b/js/three/three.min.js similarity index 100% rename from static/js/three/three.min.js rename to js/three/three.min.js diff --git a/sql/backup.pgsql b/sql/backup.pgsql index 0d376e5..49e4e0f 100644 --- a/sql/backup.pgsql +++ b/sql/backup.pgsql @@ -15,9 +15,9 @@ CREATE TYPE PREVIOUSNEXT AS ENUM( ); CREATE TYPE VECTOR3 AS( - x FLOAT, - y FLOAT, - z FLOAT + x REAL, + y REAL, + z REAL ); CREATE TYPE CAMERA AS( diff --git a/views/withjs.jade b/views/withjs.jade index 3638c18..ac86103 100644 --- a/views/withjs.jade +++ b/views/withjs.jade @@ -1,20 +1,6 @@ extends ./main block js - script(src="/static/js/three.js") - script(src="/static/js/Tools.js") - script(src="/static/js/three/stats.min.js") - script(src="/static/js/three/DDSLoader.js") - script(src="/static/js/three/MTLLoader.js") - script(src="/static/js/three/OBJLoader.js") - script(src="/static/js/three/OBJMTLLoader.js") - -//script(src="/static/js/three/OrbitControls.js") - script(src="/static/js/Cube.js") - script(src="/static/js/ProgressiveSphere.js") - script(src="/static/js/Camera.js") - script(src="/static/js/BouncingCube.js") - script(src="/static/js/BufferGeometryToGeometry.js") - script(src="/static/js/PointerCamera.js") - script(src="/static/js/CameraContainer.js") - script(src="/static/js/Hermite.js") - script static_path="/static/"; + script(src="/static/js/three.min.js") + script(src="/static/js/stats.min.js") + script(src="/static/js/threetools.min.js")