repo: janusweb
action: commit
revision: 
path_from: 
revision_from: a4655fa61513e8c8f3080ffcc958e238626422b0:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit a4655fa61513e8c8f3080ffcc958e238626422b0
Author: James Baicoianu 
Date:   Sun Jan 30 13:41:51 2022 -0800

    Line segment transparency/fog/renderOrder fixes

diff --git a/scripts/elements/linesegments.js b/scripts/elements/linesegments.js
index f78a40aba689b4ce32f2deefcac8c04775a1e0e5..
index ..debc472977f23fa1f5e3acaa798e3056d645eaa1 100644
--- a/scripts/elements/linesegments.js
+++ b/scripts/elements/linesegments.js
@@ -6,6 +6,7 @@ elation.require(['janusweb.janusbase'], function() {
     linewidth: 1,
     depth_write: true,
     depth_test: true,
+    fog: true,

     create() {

@@ -33,16 +34,18 @@ elation.require(['janusweb.janusbase'], function() {
           let lineobj = new THREE.LineSegments(geo, new THREE.LineBasicMaterial({
             vertexColors: THREE.VertexColors,
             opacity: this.opacity,
-            transparent: (this.opacity < 1),
+            transparent: (this.transparent !== null ? this.transparent : this.opacity < 1),
             depthWrite: this.depth_write,
             depthTest: this.depth_test,
             linewidth: this.linewidth,
+            fog: this.fog,
           }));
+          lineobj.renderOrder = this.renderorder;
           this.objects['3d'].add(lineobj);
           if (this.pickable || this.collidable) {
             //this.colliders.add(lineobj.clone());
           }
-          lineobj.userData.thing = this;
+          lineobj.userData.thing = this._target || this;
           this.geometry = geo;
           this.lineobj = lineobj;
         }

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