From 49a26c60bcc5e710227079605b15b4cd5e5d049d Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Wed, 3 Jun 2015 09:44:15 +0200 Subject: [PATCH] Added red coins --- js/PointerCamera.js | 1 - js/prototype/initScene.js | 25 ++++++++++++++++++++++--- js/prototype/main.js | 4 ++-- js/three/threex.transparency.js | 6 ++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/js/PointerCamera.js b/js/PointerCamera.js index c562d2f..96a67a2 100644 --- a/js/PointerCamera.js +++ b/js/PointerCamera.js @@ -385,7 +385,6 @@ var History = function() { this.states = new Array(); this.index = -1; this.size = 0; - console.log('New state ' + this.index + ' / ' + this.size); } History.prototype.addState = function(state) { diff --git a/js/prototype/initScene.js b/js/prototype/initScene.js index b3dddca..efc20db 100644 --- a/js/prototype/initScene.js +++ b/js/prototype/initScene.js @@ -447,6 +447,7 @@ function initWhompScene(scene, collidableObjects, loader, static_path) { if (obj.material.name === 'Shape_088' || obj.material.name === 'Shape_089') { + obj.raycastable = false; THREEx.Transparency.push(obj); } else if (obj.material.name === 'Shape_113') { THREEx.Transparency.push(obj); @@ -467,7 +468,16 @@ function createWhompCameras(width, height) { } function createWhompCoins() { - return []; + return [ + new Coin(-55.29176900669821,28.86514571524507,41.27968972716147), + new Coin(-33.36263561768484,93.41710952326468,10.230063543998414), + new Coin(19.85057515492925,121.51756532082196,13.355674703297925), + new Coin(81.00383890535953,46.489182333624335,19.132972963126775), + new Coin(6.049016864458896,62.498603432959584,36.272087520336264), + new Coin(-14.497656612870164,62.63594147452652,-40.488101538390694), + new Coin(67.53883218882444,23.19245026490682,-70.01046531863012), + new Coin(34.354286209455246,34.87313067990168,-40.91947594995703) + ]; } function resetWhompElements() { @@ -493,7 +503,7 @@ function initWhomp(camera, scene, static_path) { scene.add(camera); - Coin.init(); + Coin.init(0.01); coins = createWhompCoins(); var otherCams = createWhompCameras(container_size.width(), container_size.height()); @@ -545,7 +555,16 @@ function initMountainScene(scene, collidableObjects, loader, static_path) { } function createMountainCoins() { - return []; + return [ + new Coin(-18.766484229298513,-6.174512332611151,16.379061147364553), + new Coin(-22.48878786991581,-17.698282433679474,1.6030258853572397), + new Coin(-8.604868977581164,-17.3348862459467,-11.923191659094416), + new Coin(24.81563047462934,-12.174170400556296,5.612049952487652), + new Coin(-6.4854226987006305,0.34787283214634307,-17.2093293607182), + new Coin(-14.50190371481413,20.88721463986533,7.923724946536855), + new Coin(-13.980787439949077,-0.10719616576499978,22.24889144136683), + new Coin(4.491305202472262,3.6813420775366277,10.03229664467681) + ]; } function createMountainCameras(width, height) { diff --git a/js/prototype/main.js b/js/prototype/main.js index 5afa346..7620694 100644 --- a/js/prototype/main.js +++ b/js/prototype/main.js @@ -78,9 +78,9 @@ function init() { // Initialize pointer camera var camera1 = new PointerCamera(50, container_size.width() / container_size.height(), 0.01, 100000, renderer, container); - cameras = initBobomb(camera1, scene, static_path); + // cameras = initBobomb(camera1, scene, static_path); // cameras = initWhomp(camera1, scene, static_path); - // cameras = initMountain(camera1, scene, static_path); + cameras = initMountain(camera1, scene, static_path); // Add listeners initListeners(); diff --git a/js/three/threex.transparency.js b/js/three/threex.transparency.js index 1f26207..9f17b16 100644 --- a/js/three/threex.transparency.js +++ b/js/three/threex.transparency.js @@ -14,8 +14,9 @@ THREEx.Transparency.objects = []; THREEx.Transparency.init = function(objects){ objects.forEach(function(object){ THREEx.Transparency.objects.push(object); - object.material.transparent = true - object.material.depthWrite = false + object.material.transparent = true; + object.material.depthWrite = false; + object.raycastable = false; }); } @@ -24,6 +25,7 @@ THREEx.Transparency.push = function() { THREEx.Transparency.objects.push(arguments[i]); arguments[i].material.transparent = true; arguments[i].material.depthWrite = false; + arguments[i].raycastable = false; } }