mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import BaseSerializer from '../BaseSerializer';
|
|
import BufferGeometrySerializer from './BufferGeometrySerializer';
|
|
|
|
/**
|
|
* BoxBufferGeometrySerializer
|
|
* @author tengge / https://github.com/tengge1
|
|
* @param {*} app
|
|
*/
|
|
function BoxBufferGeometrySerializer(app) {
|
|
BaseSerializer.call(this, app);
|
|
}
|
|
|
|
BoxBufferGeometrySerializer.prototype = Object.create(BaseSerializer.prototype);
|
|
BoxBufferGeometrySerializer.prototype.constructor = BoxBufferGeometrySerializer;
|
|
|
|
BoxBufferGeometrySerializer.prototype.toJSON = function (obj) {
|
|
return BufferGeometrySerializer.prototype.toJSON.call(this, obj);
|
|
};
|
|
|
|
BoxBufferGeometrySerializer.prototype.fromJSON = function (json, parent) {
|
|
var obj = parent === undefined ? new THREE.BoxBufferGeometry(
|
|
json.parameters.width,
|
|
json.parameters.height,
|
|
json.parameters.depth,
|
|
json.parameters.widthSegments,
|
|
json.parameters.heightSegments,
|
|
json.parameters.depthSegments
|
|
) : parent;
|
|
|
|
BufferGeometrySerializer.prototype.fromJSON.call(this, json, obj);
|
|
|
|
return obj;
|
|
};
|
|
|
|
export default BoxBufferGeometrySerializer; |