-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: janusweb
action: commit
revision:
path_from:
revision_from: ee343efac60f4dc5a5421f32f5e7a05d1ae7e24e:
path_to:
revision_to:

git.thebackupbox.net

janusweb

git://git.thebackupbox.net/janusweb

commit ee343efac60f4dc5a5421f32f5e7a05d1ae7e24e
Author: James Baicoianu <james_github@baicoianu.com>
Date:   Sun Jun 18 21:29:19 2017 -0700

    Updated lights to work the same way as native

diff --git a/scripts/januslight.js b/scripts/januslight.js

index 5dade242d17d483f43c034f3040a889b9d114516..

index ..b460da41842dd0274a0335cc804fa16b2e4c2ee9 100644

--- a/scripts/januslight.js
+++ b/scripts/januslight.js
@@ -12,15 +12,16 @@ elation.require(['janusweb.janusbase'], function() {
     this.createObject3D = function() {
       var obj = new THREE.Object3D();
       if (this.light_cone_angle == 0) {
-        this.light = new THREE.PointLight(this.properties.color, this.light_intensity / 100, this.light_range);
+        this.light = new THREE.PointLight(this.properties.color, 1, this.light_range);
         this.light.position.set(0,0,0);
         obj.add(this.light);
       } else if (this.light_cone_angle > 0) {
         var angle = Math.acos(this.light_cone_angle);
-        this.light = new THREE.SpotLight(this.properties.color, this.light_intensity / 100, this.light_range, angle);
+        this.light = new THREE.SpotLight(this.properties.color, 1, this.light_range, angle);
         //this.light.position.set(0,0,0);
         obj.add(this.light);
       }
+      this.updateLight();
       return obj;
     }
     this.createChildren = function() {
@@ -46,8 +47,11 @@ elation.require(['janusweb.janusbase'], function() {
     }
     this.updateLight = function() {
       if (this.light) {
-        this.light.intensity = this.light_intensity / 100;
+        //this.light.intensity = this.light_intensity / 100;
+        var avgscale = (this.scale.x + this.scale.y + this.scale.z) / 3;
         this.light.color.copy(this.color);
+        this.light.color.multiplyScalar(this.light_intensity * avgscale * avgscale);
+        this.light.range = this.light_range * avgscale;
       }
     }
     this.getProxyObject = function() {

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 14:22:45 2024