starry / backend /libs /three /core /InstancedInterleavedBuffer.js
k-l-lambda's picture
feat: add Python ML services (CPU mode) with model download
2b7aae2
import { InterleavedBuffer } from './InterleavedBuffer.js';
class InstancedInterleavedBuffer extends InterleavedBuffer {
constructor(array, stride, meshPerAttribute = 1) {
super(array, stride);
this.meshPerAttribute = meshPerAttribute;
}
copy(source) {
super.copy(source);
this.meshPerAttribute = source.meshPerAttribute;
return this;
}
clone(data) {
const ib = super.clone(data);
ib.meshPerAttribute = this.meshPerAttribute;
return ib;
}
toJSON(data) {
const json = super.toJSON(data);
json.isInstancedInterleavedBuffer = true;
json.meshPerAttribute = this.meshPerAttribute;
return json;
}
}
InstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;
export { InstancedInterleavedBuffer };