Skip to content
Snippets Groups Projects
Commit bcb25ad3 authored by Greg Fodor's avatar Greg Fodor
Browse files

Remove persistence cod

parent d5687de2
No related branches found
No related tags found
No related merge requests found
......@@ -211,38 +211,6 @@ export default class SceneEntryManager {
spawnMediaInfrontOfPlayer(e.detail, contentOrigin);
});
this.scene.addEventListener("object_pinned", e => {
const el = e.detail.el;
if (!NAF.utils.isMine(el)) return;
// Construct a GLTF node from this entity
const object3D = el.object3D;
const components = el.components;
const networkId = components.networked.data.networkId;
const gltfComponents = {};
const gltfNode = { name: networkId, extensions: { HUBS_components: gltfComponents } };
// Adapted from three.js GLTFExporter
const equalArray = (x, y) => x.length === y.length && x.every((v, i) => v === y[i]);
const rotation = object3D.quaternion.toArray();
const position = object3D.position.toArray();
const scale = object3D.scale.toArray();
if (!equalArray(rotation, [0, 0, 0, 1])) gltfNode.rotation = rotation;
if (!equalArray(position, [0, 0, 0])) gltfNode.translation = position;
if (!equalArray(scale, [1, 1, 1])) gltfNode.scale = scale;
if (components["media-loader"]) {
gltfComponents.media = { src: components["media-loader"].data.src, networkId };
}
});
this.scene.addEventListener("object_unpinned", e => {
const el = e.detail.el;
if (!NAF.utils.isMine(el)) return;
});
this.scene.addEventListener("object_spawned", e => {
this.hubChannel.sendObjectSpawnedEvent(e.detail.objectType);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment