-- 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: b85b8657941ad1028e610ca2e4e0f34ffdfc5ac6:
path_to:
revision_to:

git.thebackupbox.net

janusweb

git://git.thebackupbox.net/janusweb

commit b85b8657941ad1028e610ca2e4e0f34ffdfc5ac6
Author: James Baicoianu <james_github@baicoianu.com>
Date:   Tue Oct 9 14:38:22 2018 -0700

    Visible self-avatar

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

index 5035de7f866e9c9306a1d771cffb5109fa4b556c..

index ..0474a26d28ed484f29ff6211681b1da9d1323ab5 100644

--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -124,6 +124,14 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
       elation.events.add(this.gazecaster, 'raycastleave', elation.bind(this, this.handleGazeLeave));
       elation.events.add(this.gazecaster, 'raycastmove', elation.bind(this, this.handleGazeMove));

+      let avatar = this.getAvatarData();
+      if (avatar) {
+        this.ghost = this.createObject('ghost', {
+          ghost_id: this.getUsername(),
+          avatar_src: 'data:text/plain,' + avatar
+        });
+      }
+
       this.updateCollider();
     }
     this.enable = function() {
@@ -257,6 +265,17 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
           }
         }
       }
+
+      if (this.ghost) {
+        if (this.ghost.head) {
+          this.ghost.head.position.copy(this.head.position);
+          this.ghost.head.orientation.copy(this.head.orientation).multiply(this.neck.orientation);
+        }
+        if (this.ghost.body) {
+          this.ghost.body.position.copy(this.body.position);
+          this.ghost.body.orientation.copy(this.body.orientation);
+        }
+      }
     })();
     this.updateCursor = (function() {
       var _tmpvec = new THREE.Vector3();
@@ -500,7 +519,16 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
     }
     this.setAvatar = function(avatar) {
       this.avatarNeedsUpdate = true;
-      return this.setSetting('avatar', avatar);
+      let setting = this.setSetting('avatar', avatar);
+
+      if (this.ghost) {
+        this.ghost.die();
+      }
+      this.ghost = this.createObject('ghost', {
+        ghost_src: avatar
+      });
+
+      return setting;
     }
     this.hasVoipData = function() {
       return this.voipqueue && this.voipqueue.length > 0;

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

-- Response ended

-- Page fetched on Sun Jun 2 14:19:50 2024