Skip to content

Commit

Permalink
Work with scene and objects
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmooney committed Apr 26, 2024
1 parent 264798b commit 45071f8
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,17 @@ export class GatherWorker implements IJCadWorker {
return;
}

console.log('msg', msg);
// if (msg.payload && Object.keys(msg.payload).length > 0) {
// const jCadObject = msg.payload['jcObject'];
// const modelArrayBuffer = msg.payload['postShape'];
if (msg.payload && Object.keys(msg.payload).length > 0) {
const jCadObject = msg.payload['jcObject'];
const modelArrayBuffer = msg.payload['postShape'];

// this._modelRegistry.registerModel({
// name: jCadObject.name.toLowerCase(),
// gltf: modelArrayBuffer
// });
// }
console.log('msg.payload', msg.payload);
// const jCadObject = msg.payload['jcObject'];

const modelArrayBuffer = msg.payload;

this._modelRegistry.registerModel({
name: 'scene',
gltf: modelArrayBuffer
});
this._modelRegistry.registerModel({
name: jCadObject.name.toLowerCase(),
gltf: modelArrayBuffer
});
}
}

private _ready = new PromiseDelegate<void>();
private _messageHandlers = new Map();
private _modelRegistry: IModelRegistry;
Expand Down

0 comments on commit 45071f8

Please sign in to comment.