repo: janusweb action: commit revision: path_from: revision_from: b5378e3bed90f9c5586457140758428e667719d7: path_to: revision_to:
commit b5378e3bed90f9c5586457140758428e667719d7 Author: James BaicoianuDate: Sun Oct 16 19:07:46 2016 -0700 Parse remote player avatar definitions diff --git a/scripts/remoteplayer.js b/scripts/remoteplayer.js
--- a/scripts/remoteplayer.js
+++ b/scripts/remoteplayer.js
@@ -2,6 +2,7 @@ elation.require(['engine.things.generic', 'engine.things.maskgenerator', 'engine
elation.component.add('engine.things.remoteplayer', function() {
this.postinit = function() {
this.defineProperties({
+ janus: { type: 'object' },
startposition: {type: 'vector3', default: new THREE.Vector3()},
pickable: {type: 'boolean', default: false},
collidable: {type: 'boolean', default: false},
@@ -76,12 +77,10 @@ elation.component.add('engine.things.remoteplayer', function() {
//console.log(avatar);
if (!this.avatarcode || this.avatarcode != avatar) {
this.avatarcode = avatar;
- if (this.avatarroom) {
- this.avatarroom.die();
- }
+ var things = this.janus.parser.parse(avatar);
//this.avatarroom = this.spawn('janusroom', null, { source: avatar });
//console.log(this.avatarroom);
-console.log('avatar changed:', this, avatar);
+console.log('avatar changed:', this, things, avatar);
}
}
-----END OF PAGE-----