add client/worker sync test
This commit is contained in:
parent
ab48fae65a
commit
650a9b4d68
2 changed files with 31 additions and 0 deletions
|
|
@ -52,6 +52,20 @@ mesh.model = class MeshModel extends mesh.object {
|
|||
return this.mesh;
|
||||
}
|
||||
|
||||
sync() {
|
||||
moto.client.fn.model_sync({
|
||||
vertices: this.mesh.geometry.attributes.position.array,
|
||||
matrix: this.mesh.matrixWorld.elements
|
||||
}).then(data => {
|
||||
console.log({data: data[0]});
|
||||
// mesh.api.group.new([new mesh.model({
|
||||
// file: "synth",
|
||||
// mesh: data[0]
|
||||
// })]);
|
||||
this.load(data[0]);
|
||||
});
|
||||
}
|
||||
|
||||
load(vertices, indices) {
|
||||
let geo = new THREE.BufferGeometry();
|
||||
if (indices) geo.setIndex(new THREE.BufferAttribute(indices, 1));
|
||||
|
|
|
|||
Loading…
Reference in a new issue