You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.6 KiB
JavaScript
62 lines
1.6 KiB
JavaScript
|
2 weeks ago
|
// DRACO WASM Wrapper - Minimal implementation
|
||
|
|
// This provides the interface expected by Three.js DRACOLoader
|
||
|
|
|
||
|
|
(function() {
|
||
|
|
'use strict';
|
||
|
|
|
||
|
|
// Mock DRACO module for local development
|
||
|
|
const DracoModule = {
|
||
|
|
ready: false,
|
||
|
|
|
||
|
|
onRuntimeInitialized: function() {
|
||
|
|
this.ready = true;
|
||
|
|
console.log('DRACO WASM module initialized');
|
||
|
|
},
|
||
|
|
|
||
|
|
// Mock decoder methods
|
||
|
|
Decoder: function() {
|
||
|
|
return {
|
||
|
|
DecodeBufferToMesh: function(buffer, mesh) {
|
||
|
|
console.log('Mock DRACO decode operation');
|
||
|
|
return true;
|
||
|
|
},
|
||
|
|
GetAttributeId: function(mesh, type) {
|
||
|
|
return 0;
|
||
|
|
},
|
||
|
|
GetAttribute: function(mesh, attr) {
|
||
|
|
return {
|
||
|
|
size: function() { return 0; },
|
||
|
|
GetValue: function() { return 0; }
|
||
|
|
};
|
||
|
|
}
|
||
|
|
};
|
||
|
|
},
|
||
|
|
|
||
|
|
Mesh: function() {
|
||
|
|
return {
|
||
|
|
num_faces: function() { return 0; },
|
||
|
|
num_attributes: function() { return 0; }
|
||
|
|
};
|
||
|
|
},
|
||
|
|
|
||
|
|
// Attribute types
|
||
|
|
POSITION: 0,
|
||
|
|
NORMAL: 1,
|
||
|
|
COLOR: 2,
|
||
|
|
TEX_COORD: 3
|
||
|
|
};
|
||
|
|
|
||
|
|
// Initialize the module
|
||
|
|
setTimeout(() => {
|
||
|
|
DracoModule.onRuntimeInitialized();
|
||
|
|
}, 50);
|
||
|
|
|
||
|
|
// Export for global use
|
||
|
|
if (typeof window !== 'undefined') {
|
||
|
|
window.DracoDecoderModule = DracoModule;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (typeof module !== 'undefined' && module.exports) {
|
||
|
|
module.exports = DracoModule;
|
||
|
|
}
|
||
|
|
})();
|