kitchen-simulator 1.1.1-test.48 → 1.1.1-test.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/KitchenConfiguratorApp.js +3 -0
- package/package.json +1 -1
- package/es/@history.js +0 -2
- package/es/AppContext.js +0 -3
- package/es/KitchenConfigurator.js +0 -645
- package/es/KitchenConfiguratorApp.js +0 -478
- package/es/actions/area-actions.js +0 -14
- package/es/actions/export.js +0 -23
- package/es/actions/groups-actions.js +0 -89
- package/es/actions/holes-actions.js +0 -119
- package/es/actions/items-actions.js +0 -313
- package/es/actions/lines-actions.js +0 -81
- package/es/actions/project-actions.js +0 -281
- package/es/actions/scene-actions.js +0 -33
- package/es/actions/vertices-actions.js +0 -27
- package/es/actions/viewer2d-actions.js +0 -58
- package/es/actions/viewer3d-actions.js +0 -23
- package/es/catalog/areas/area/planner-element.js +0 -40
- package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/es/catalog/areas/area/textures/grass.jpg +0 -0
- package/es/catalog/areas/area/textures/parquet.jpg +0 -0
- package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/es/catalog/areas/area/textures/tile1.jpg +0 -0
- package/es/catalog/catalog.js +0 -277
- package/es/catalog/envMap/nx.hdr +0 -0
- package/es/catalog/envMap/ny.hdr +0 -0
- package/es/catalog/envMap/nz.hdr +0 -0
- package/es/catalog/envMap/px.hdr +0 -0
- package/es/catalog/envMap/py.hdr +0 -0
- package/es/catalog/envMap/pz.hdr +0 -0
- package/es/catalog/factories/area-factory-3d.js +0 -181
- package/es/catalog/factories/area-factory.js +0 -81
- package/es/catalog/factories/export.js +0 -7
- package/es/catalog/factories/wall-factory-3d.js +0 -202
- package/es/catalog/factories/wall-factory.js +0 -268
- package/es/catalog/holes/door-closet/planner-element.js +0 -222
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +0 -315
- package/es/catalog/holes/door-exterior/planner-element.js +0 -215
- package/es/catalog/holes/door-interior/planner-element.js +0 -227
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +0 -503
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +0 -463
- package/es/catalog/holes/door-sliding/planner-element.js +0 -225
- package/es/catalog/holes/doorway-framed/planner-element.js +0 -145
- package/es/catalog/holes/doorway-frameless/planner-element.js +0 -104
- package/es/catalog/holes/export.js +0 -13
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +0 -166
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +0 -165
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +0 -303
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +0 -276
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +0 -70
- package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/es/catalog/lines/wall/wall.png +0 -0
- package/es/catalog/molding/molding-dcm/planner-element.js +0 -28
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +0 -28
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +0 -28
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -116
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -97
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -101
- package/es/catalog/properties/property-length-measure.js +0 -134
- package/es/catalog/properties/property-length-measure_hole.js +0 -101
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -82
- package/es/catalog/utils/exporter.js +0 -148
- package/es/catalog/utils/geom-utils.js +0 -189
- package/es/catalog/utils/item-loader.js +0 -1521
- package/es/catalog/utils/load-obj.js +0 -91
- package/es/catalog/utils/mtl-loader.js +0 -358
- package/es/catalog/utils/obj-loader.js +0 -477
- package/es/class/FuseUtils.js +0 -82
- package/es/class/area.js +0 -145
- package/es/class/export.js +0 -24
- package/es/class/group.js +0 -440
- package/es/class/guide.js +0 -62
- package/es/class/hole.js +0 -929
- package/es/class/item.js +0 -1883
- package/es/class/layer.js +0 -667
- package/es/class/line.js +0 -1180
- package/es/class/project.js +0 -793
- package/es/class/vertex.js +0 -202
- package/es/components/content.js +0 -107
- package/es/components/disclaimer/disclaimer.js +0 -97
- package/es/components/export.js +0 -9
- package/es/components/style/button.js +0 -113
- package/es/components/style/cancel-button.js +0 -22
- package/es/components/style/content-container.js +0 -33
- package/es/components/style/content-title.js +0 -29
- package/es/components/style/delete-button.js +0 -25
- package/es/components/style/export.js +0 -31
- package/es/components/style/form-block.js +0 -24
- package/es/components/style/form-color-input.js +0 -27
- package/es/components/style/form-label.js +0 -26
- package/es/components/style/form-number-input.js +0 -213
- package/es/components/style/form-number-input_2.js +0 -206
- package/es/components/style/form-select.js +0 -68
- package/es/components/style/form-slider.js +0 -61
- package/es/components/style/form-submit-button.js +0 -26
- package/es/components/style/form-text-input.js +0 -95
- package/es/components/viewer2d/area.js +0 -81
- package/es/components/viewer2d/export.js +0 -31
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -37
- package/es/components/viewer2d/grids/grids.js +0 -35
- package/es/components/viewer2d/group.js +0 -53
- package/es/components/viewer2d/item.js +0 -513
- package/es/components/viewer2d/layer.js +0 -164
- package/es/components/viewer2d/line.js +0 -882
- package/es/components/viewer2d/ruler.js +0 -100
- package/es/components/viewer2d/rulerDist.js +0 -146
- package/es/components/viewer2d/rulerX.js +0 -151
- package/es/components/viewer2d/rulerY.js +0 -153
- package/es/components/viewer2d/scene.js +0 -140
- package/es/components/viewer2d/snap.js +0 -74
- package/es/components/viewer2d/state.js +0 -78
- package/es/components/viewer2d/utils.js +0 -198
- package/es/components/viewer2d/vertex.js +0 -65
- package/es/components/viewer2d/viewer2d.js +0 -1398
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2592
- package/es/components/viewer3d/dcm.js +0 -401
- package/es/components/viewer3d/fbm.js +0 -414
- package/es/components/viewer3d/front3D.js +0 -66
- package/es/components/viewer3d/grid-creator.js +0 -25
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -36
- package/es/components/viewer3d/grids/grid-streak.js +0 -27
- package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -36
- package/es/components/viewer3d/libs/first-person-controls.js +0 -67
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1281
- package/es/components/viewer3d/libs/mtl-loader.js +0 -357
- package/es/components/viewer3d/libs/obj-loader.js +0 -462
- package/es/components/viewer3d/libs/orbit-controls.js +0 -699
- package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -46
- package/es/components/viewer3d/lrm.js +0 -305
- package/es/components/viewer3d/model.js +0 -708
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -115
- package/es/components/viewer3d/ruler-utils/itemRect.js +0 -61
- package/es/components/viewer3d/ruler-utils/layer3D.js +0 -495
- package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -227
- package/es/components/viewer3d/ruler-utils/scene3D.js +0 -60
- package/es/components/viewer3d/ruler-utils/state3D.js +0 -18
- package/es/components/viewer3d/scene-creator.js +0 -3608
- package/es/components/viewer3d/three-memory-cleaner.js +0 -51
- package/es/components/viewer3d/viewer3d-first-person.js +0 -315
- package/es/components/viewer3d/viewer3d.js +0 -2527
- package/es/constants.js +0 -636
- package/es/index.js +0 -16
- package/es/models.js +0 -510
- package/es/plugins/SVGLoader.js +0 -1412
- package/es/plugins/autosave.js +0 -33
- package/es/plugins/console-debugger.js +0 -37
- package/es/plugins/export.js +0 -9
- package/es/plugins/keyboard.js +0 -101
- package/es/reducers/areas-reducer.js +0 -12
- package/es/reducers/export.js +0 -25
- package/es/reducers/groups-reducer.js +0 -38
- package/es/reducers/holes-reducer.js +0 -62
- package/es/reducers/items-reducer.js +0 -140
- package/es/reducers/lines-reducer.js +0 -45
- package/es/reducers/project-reducer.js +0 -129
- package/es/reducers/reducer.js +0 -19
- package/es/reducers/scene-reducer.js +0 -28
- package/es/reducers/user-reducer.js +0 -40
- package/es/reducers/vertices-reducer.js +0 -19
- package/es/reducers/viewer2d-reducer.js +0 -75
- package/es/reducers/viewer3d-reducer.js +0 -56
- package/es/shared-style.js +0 -66
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/es/translator/en.js +0 -104
- package/es/translator/it.js +0 -79
- package/es/translator/ru.js +0 -79
- package/es/translator/translator.js +0 -84
- package/es/utils/browser.js +0 -33
- package/es/utils/email-validator.js +0 -4
- package/es/utils/export.js +0 -25
- package/es/utils/geometry.js +0 -2420
- package/es/utils/get-edges-of-subgraphs.js +0 -27
- package/es/utils/graph-cycles.js +0 -237
- package/es/utils/graph-inner-cycles.js +0 -46
- package/es/utils/graph.js +0 -150
- package/es/utils/helper.js +0 -268
- package/es/utils/history.js +0 -29
- package/es/utils/id-broker.js +0 -19
- package/es/utils/logger.js +0 -8
- package/es/utils/math.js +0 -50
- package/es/utils/molding.js +0 -871
- package/es/utils/name-generator.js +0 -18
- package/es/utils/objects-utils.js +0 -50
- package/es/utils/phone-validator.js +0 -4
- package/es/utils/process-black-list.js +0 -18
- package/es/utils/react-if.js +0 -18
- package/es/utils/snap-scene.js +0 -99
- package/es/utils/snap.js +0 -237
- package/es/utils/summarizeCart.js +0 -24
- package/es/utils/threeCSG.es6.js +0 -498
- package/es/version.js +0 -2
- package/lib/catalog/properties/property-string.js +0 -55
- package/lib/catalog/properties/property-toggle.js +0 -46
- package/lib/catalog/properties/shared-property-style.js +0 -20
- package/lib/catalog/utils/FuseUtils.js +0 -88
- package/lib/catalog/utils/exporter.js +0 -155
- package/lib/catalog/utils/geom-utils.js +0 -205
- package/lib/catalog/utils/item-loader.js +0 -1533
- package/lib/catalog/utils/load-obj.js +0 -99
- package/lib/catalog/utils/mtl-loader.js +0 -363
- package/lib/catalog/utils/obj-loader.js +0 -482
- package/lib/class/FuseUtils.js +0 -88
- package/lib/class/area.js +0 -150
- package/lib/class/export.js +0 -96
- package/lib/class/group.js +0 -445
- package/lib/class/guide.js +0 -67
- package/lib/class/hole.js +0 -934
- package/lib/class/item.js +0 -1889
- package/lib/class/layer.js +0 -672
- package/lib/class/line.js +0 -1186
- package/lib/class/project.js +0 -799
- package/lib/class/vertex.js +0 -207
- package/lib/components/content.js +0 -116
- package/lib/components/disclaimer/disclaimer.js +0 -105
- package/lib/components/export.js +0 -33
- package/lib/components/style/button.js +0 -120
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -40
- package/lib/components/style/content-title.js +0 -37
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/export.js +0 -121
- package/lib/components/style/form-block.js +0 -31
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -33
- package/lib/components/style/form-number-input.js +0 -220
- package/lib/components/style/form-number-input_2.js +0 -213
- package/lib/components/style/form-select.js +0 -75
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -101
- package/lib/components/viewer2d/area.js +0 -88
- package/lib/components/viewer2d/export.js +0 -121
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer2d/grids/grids.js +0 -44
- package/lib/components/viewer2d/group.js +0 -62
- package/lib/components/viewer2d/item.js +0 -521
- package/lib/components/viewer2d/layer.js +0 -171
- package/lib/components/viewer2d/line.js +0 -892
- package/lib/components/viewer2d/ruler.js +0 -107
- package/lib/components/viewer2d/rulerDist.js +0 -153
- package/lib/components/viewer2d/rulerX.js +0 -158
- package/lib/components/viewer2d/rulerY.js +0 -160
- package/lib/components/viewer2d/scene.js +0 -147
- package/lib/components/viewer2d/snap.js +0 -83
- package/lib/components/viewer2d/state.js +0 -87
- package/lib/components/viewer2d/utils.js +0 -210
- package/lib/components/viewer2d/vertex.js +0 -74
- package/lib/components/viewer2d/viewer2d.js +0 -1405
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2597
- package/lib/components/viewer3d/dcm.js +0 -407
- package/lib/components/viewer3d/fbm.js +0 -420
- package/lib/components/viewer3d/front3D.js +0 -75
- package/lib/components/viewer3d/grid-creator.js +0 -34
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer3d/grids/grid-streak.js +0 -35
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer3d/libs/first-person-controls.js +0 -74
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1287
- package/lib/components/viewer3d/libs/mtl-loader.js +0 -363
- package/lib/components/viewer3d/libs/obj-loader.js +0 -468
- package/lib/components/viewer3d/libs/orbit-controls.js +0 -705
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -52
- package/lib/components/viewer3d/lrm.js +0 -311
- package/lib/components/viewer3d/model.js +0 -714
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -122
- package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -68
- package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -502
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -234
- package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -68
- package/lib/components/viewer3d/ruler-utils/state3D.js +0 -25
- package/lib/components/viewer3d/scene-creator.js +0 -3642
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -60
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -320
- package/lib/components/viewer3d/viewer3d.js +0 -2532
- package/lib/constants.js +0 -645
- package/lib/index.js +0 -96
- package/lib/models.js +0 -517
- package/lib/plugins/SVGLoader.js +0 -1417
- package/lib/plugins/autosave.js +0 -39
- package/lib/plugins/console-debugger.js +0 -44
- package/lib/plugins/export.js +0 -33
- package/lib/plugins/keyboard.js +0 -107
- package/lib/reducers/areas-reducer.js +0 -18
- package/lib/reducers/export.js +0 -97
- package/lib/reducers/groups-reducer.js +0 -44
- package/lib/reducers/holes-reducer.js +0 -68
- package/lib/reducers/items-reducer.js +0 -146
- package/lib/reducers/lines-reducer.js +0 -51
- package/lib/reducers/project-reducer.js +0 -135
- package/lib/reducers/reducer.js +0 -26
- package/lib/reducers/scene-reducer.js +0 -34
- package/lib/reducers/user-reducer.js +0 -46
- package/lib/reducers/vertices-reducer.js +0 -25
- package/lib/reducers/viewer2d-reducer.js +0 -82
- package/lib/reducers/viewer3d-reducer.js +0 -63
- package/lib/shared-style.js +0 -72
- package/lib/styles/export.js +0 -13
- package/lib/translator/en.js +0 -110
- package/lib/translator/it.js +0 -85
- package/lib/translator/ru.js +0 -85
- package/lib/translator/translator.js +0 -90
- package/lib/utils/browser.js +0 -40
- package/lib/utils/email-validator.js +0 -10
- package/lib/utils/export.js +0 -56
- package/lib/utils/geometry.js +0 -2516
- package/lib/utils/get-edges-of-subgraphs.js +0 -34
- package/lib/utils/graph-cycles.js +0 -240
- package/lib/utils/graph-inner-cycles.js +0 -54
- package/lib/utils/graph.js +0 -157
- package/lib/utils/helper.js +0 -291
- package/lib/utils/history.js +0 -36
- package/lib/utils/id-broker.js +0 -25
- package/lib/utils/logger.js +0 -14
- package/lib/utils/math.js +0 -57
- package/lib/utils/molding.js +0 -895
- package/lib/utils/name-generator.js +0 -23
- package/lib/utils/objects-utils.js +0 -60
- package/lib/utils/phone-validator.js +0 -10
- package/lib/utils/process-black-list.js +0 -24
- package/lib/utils/react-if.js +0 -24
- package/lib/utils/snap-scene.js +0 -105
- package/lib/utils/snap.js +0 -249
- package/lib/utils/summarizeCart.js +0 -30
- package/lib/utils/threeCSG.es6.js +0 -503
- package/lib/version.js +0 -8
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* @author mrdoob / http://mrdoob.com/
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
var THREE = window.THREE || require('three');
|
|
12
|
-
var OBJLoader;
|
|
13
|
-
OBJLoader = function OBJLoader(manager) {
|
|
14
|
-
this.manager = manager !== undefined ? manager : THREE.DefaultLoadingManager;
|
|
15
|
-
this.materials = null;
|
|
16
|
-
this.regexp = {
|
|
17
|
-
// v float float float
|
|
18
|
-
vertex_pattern: /^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
|
|
19
|
-
// vn float float float
|
|
20
|
-
normal_pattern: /^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
|
|
21
|
-
// vt float float
|
|
22
|
-
uv_pattern: /^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
|
|
23
|
-
// f vertex vertex vertex
|
|
24
|
-
face_vertex: /^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,
|
|
25
|
-
// f vertex/uv vertex/uv vertex/uv
|
|
26
|
-
face_vertex_uv: /^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,
|
|
27
|
-
// f vertex/uv/normal vertex/uv/normal vertex/uv/normal
|
|
28
|
-
face_vertex_uv_normal: /^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,
|
|
29
|
-
// f vertex//normal vertex//normal vertex//normal
|
|
30
|
-
face_vertex_normal: /^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,
|
|
31
|
-
// o object_name | g group_name
|
|
32
|
-
object_pattern: /^[og]\s*(.+)?/,
|
|
33
|
-
// s boolean
|
|
34
|
-
smoothing_pattern: /^s\s+(\d+|on|off)/,
|
|
35
|
-
// mtllib file_reference
|
|
36
|
-
material_library_pattern: /^mtllib /,
|
|
37
|
-
// usemtl material_name
|
|
38
|
-
material_use_pattern: /^usemtl /
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
OBJLoader.prototype = {
|
|
42
|
-
constructor: OBJLoader,
|
|
43
|
-
load: function load(url, onLoad, onProgress, onError) {
|
|
44
|
-
var scope = this;
|
|
45
|
-
var loader = new THREE.XHRLoader(scope.manager);
|
|
46
|
-
loader.setPath(this.path);
|
|
47
|
-
loader.load(url, function (text) {
|
|
48
|
-
onLoad(scope.parse(text));
|
|
49
|
-
}, onProgress, onError);
|
|
50
|
-
},
|
|
51
|
-
setPath: function setPath(value) {
|
|
52
|
-
this.path = value;
|
|
53
|
-
},
|
|
54
|
-
setMaterials: function setMaterials(materials) {
|
|
55
|
-
this.materials = materials;
|
|
56
|
-
},
|
|
57
|
-
_createParserState: function _createParserState() {
|
|
58
|
-
var state = {
|
|
59
|
-
objects: [],
|
|
60
|
-
object: {},
|
|
61
|
-
vertices: [],
|
|
62
|
-
normals: [],
|
|
63
|
-
uvs: [],
|
|
64
|
-
materialLibraries: [],
|
|
65
|
-
startObject: function startObject(name, fromDeclaration) {
|
|
66
|
-
// If the current object (initial from reset) is not from a g/o declaration in the parsed
|
|
67
|
-
// file. We need to use it for the first parsed g/o to keep things in sync.
|
|
68
|
-
if (this.object && this.object.fromDeclaration === false) {
|
|
69
|
-
this.object.name = name;
|
|
70
|
-
this.object.fromDeclaration = fromDeclaration !== false;
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (this.object && typeof this.object._finalize === 'function') {
|
|
74
|
-
this.object._finalize();
|
|
75
|
-
}
|
|
76
|
-
var previousMaterial = this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined;
|
|
77
|
-
this.object = {
|
|
78
|
-
name: name || '',
|
|
79
|
-
fromDeclaration: fromDeclaration !== false,
|
|
80
|
-
geometry: {
|
|
81
|
-
vertices: [],
|
|
82
|
-
normals: [],
|
|
83
|
-
uvs: []
|
|
84
|
-
},
|
|
85
|
-
materials: [],
|
|
86
|
-
smooth: true,
|
|
87
|
-
startMaterial: function startMaterial(name, libraries) {
|
|
88
|
-
var previous = this._finalize(false);
|
|
89
|
-
|
|
90
|
-
// New usemtl declaration overwrites an inherited material, except if faces were declared
|
|
91
|
-
// after the material, then it must be preserved for proper MultiMaterial continuation.
|
|
92
|
-
if (previous && (previous.inherited || previous.groupCount <= 0)) {
|
|
93
|
-
this.materials.splice(previous.index, 1);
|
|
94
|
-
}
|
|
95
|
-
var material = {
|
|
96
|
-
index: this.materials.length,
|
|
97
|
-
name: name || '',
|
|
98
|
-
mtllib: Array.isArray(libraries) && libraries.length > 0 ? libraries[libraries.length - 1] : '',
|
|
99
|
-
smooth: previous !== undefined ? previous.smooth : this.smooth,
|
|
100
|
-
groupStart: previous !== undefined ? previous.groupEnd : 0,
|
|
101
|
-
groupEnd: -1,
|
|
102
|
-
groupCount: -1,
|
|
103
|
-
inherited: false,
|
|
104
|
-
clone: function clone(index) {
|
|
105
|
-
return {
|
|
106
|
-
index: typeof index === 'number' ? index : this.index,
|
|
107
|
-
name: this.name,
|
|
108
|
-
mtllib: this.mtllib,
|
|
109
|
-
smooth: this.smooth,
|
|
110
|
-
groupStart: this.groupEnd,
|
|
111
|
-
groupEnd: -1,
|
|
112
|
-
groupCount: -1,
|
|
113
|
-
inherited: false
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
this.materials.push(material);
|
|
118
|
-
return material;
|
|
119
|
-
},
|
|
120
|
-
currentMaterial: function currentMaterial() {
|
|
121
|
-
if (this.materials.length > 0) {
|
|
122
|
-
return this.materials[this.materials.length - 1];
|
|
123
|
-
}
|
|
124
|
-
return undefined;
|
|
125
|
-
},
|
|
126
|
-
_finalize: function _finalize(end) {
|
|
127
|
-
var lastMultiMaterial = this.currentMaterial();
|
|
128
|
-
if (lastMultiMaterial && lastMultiMaterial.groupEnd === -1) {
|
|
129
|
-
lastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;
|
|
130
|
-
lastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;
|
|
131
|
-
lastMultiMaterial.inherited = false;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Guarantee at least one empty material, this makes the creation later more straight forward.
|
|
135
|
-
if (end !== false && this.materials.length === 0) {
|
|
136
|
-
this.materials.push({
|
|
137
|
-
name: '',
|
|
138
|
-
smooth: this.smooth
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
return lastMultiMaterial;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
// Inherit previous objects material.
|
|
146
|
-
// Spec tells us that a declared material must be set to all objects until a new material is declared.
|
|
147
|
-
// If a usemtl declaration is encountered while this new object is being parsed, it will
|
|
148
|
-
// overwrite the inherited material. Exception being that there was already face declarations
|
|
149
|
-
// to the inherited material, then it will be preserved for proper MultiMaterial continuation.
|
|
150
|
-
|
|
151
|
-
if (previousMaterial && previousMaterial.name && typeof previousMaterial.clone === 'function') {
|
|
152
|
-
var declared = previousMaterial.clone(0);
|
|
153
|
-
declared.inherited = true;
|
|
154
|
-
this.object.materials.push(declared);
|
|
155
|
-
}
|
|
156
|
-
this.objects.push(this.object);
|
|
157
|
-
},
|
|
158
|
-
finalize: function finalize() {
|
|
159
|
-
if (this.object && typeof this.object._finalize === 'function') {
|
|
160
|
-
this.object._finalize();
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
parseVertexIndex: function parseVertexIndex(value, len) {
|
|
164
|
-
var index = parseInt(value, 10);
|
|
165
|
-
return (index >= 0 ? index - 1 : index + len / 3) * 3;
|
|
166
|
-
},
|
|
167
|
-
parseNormalIndex: function parseNormalIndex(value, len) {
|
|
168
|
-
var index = parseInt(value, 10);
|
|
169
|
-
return (index >= 0 ? index - 1 : index + len / 3) * 3;
|
|
170
|
-
},
|
|
171
|
-
parseUVIndex: function parseUVIndex(value, len) {
|
|
172
|
-
var index = parseInt(value, 10);
|
|
173
|
-
return (index >= 0 ? index - 1 : index + len / 2) * 2;
|
|
174
|
-
},
|
|
175
|
-
addVertex: function addVertex(a, b, c) {
|
|
176
|
-
var src = this.vertices;
|
|
177
|
-
var dst = this.object.geometry.vertices;
|
|
178
|
-
dst.push(src[a + 0]);
|
|
179
|
-
dst.push(src[a + 1]);
|
|
180
|
-
dst.push(src[a + 2]);
|
|
181
|
-
dst.push(src[b + 0]);
|
|
182
|
-
dst.push(src[b + 1]);
|
|
183
|
-
dst.push(src[b + 2]);
|
|
184
|
-
dst.push(src[c + 0]);
|
|
185
|
-
dst.push(src[c + 1]);
|
|
186
|
-
dst.push(src[c + 2]);
|
|
187
|
-
},
|
|
188
|
-
addVertexLine: function addVertexLine(a) {
|
|
189
|
-
var src = this.vertices;
|
|
190
|
-
var dst = this.object.geometry.vertices;
|
|
191
|
-
dst.push(src[a + 0]);
|
|
192
|
-
dst.push(src[a + 1]);
|
|
193
|
-
dst.push(src[a + 2]);
|
|
194
|
-
},
|
|
195
|
-
addNormal: function addNormal(a, b, c) {
|
|
196
|
-
var src = this.normals;
|
|
197
|
-
var dst = this.object.geometry.normals;
|
|
198
|
-
dst.push(src[a + 0]);
|
|
199
|
-
dst.push(src[a + 1]);
|
|
200
|
-
dst.push(src[a + 2]);
|
|
201
|
-
dst.push(src[b + 0]);
|
|
202
|
-
dst.push(src[b + 1]);
|
|
203
|
-
dst.push(src[b + 2]);
|
|
204
|
-
dst.push(src[c + 0]);
|
|
205
|
-
dst.push(src[c + 1]);
|
|
206
|
-
dst.push(src[c + 2]);
|
|
207
|
-
},
|
|
208
|
-
addUV: function addUV(a, b, c) {
|
|
209
|
-
var src = this.uvs;
|
|
210
|
-
var dst = this.object.geometry.uvs;
|
|
211
|
-
dst.push(src[a + 0]);
|
|
212
|
-
dst.push(src[a + 1]);
|
|
213
|
-
dst.push(src[b + 0]);
|
|
214
|
-
dst.push(src[b + 1]);
|
|
215
|
-
dst.push(src[c + 0]);
|
|
216
|
-
dst.push(src[c + 1]);
|
|
217
|
-
},
|
|
218
|
-
addUVLine: function addUVLine(a) {
|
|
219
|
-
var src = this.uvs;
|
|
220
|
-
var dst = this.object.geometry.uvs;
|
|
221
|
-
dst.push(src[a + 0]);
|
|
222
|
-
dst.push(src[a + 1]);
|
|
223
|
-
},
|
|
224
|
-
addFace: function addFace(a, b, c, d, ua, ub, uc, ud, na, nb, nc, nd) {
|
|
225
|
-
var vLen = this.vertices.length;
|
|
226
|
-
var ia = this.parseVertexIndex(a, vLen);
|
|
227
|
-
var ib = this.parseVertexIndex(b, vLen);
|
|
228
|
-
var ic = this.parseVertexIndex(c, vLen);
|
|
229
|
-
var id;
|
|
230
|
-
if (d === undefined) {
|
|
231
|
-
this.addVertex(ia, ib, ic);
|
|
232
|
-
} else {
|
|
233
|
-
id = this.parseVertexIndex(d, vLen);
|
|
234
|
-
this.addVertex(ia, ib, id);
|
|
235
|
-
this.addVertex(ib, ic, id);
|
|
236
|
-
}
|
|
237
|
-
if (ua !== undefined) {
|
|
238
|
-
var uvLen = this.uvs.length;
|
|
239
|
-
ia = this.parseUVIndex(ua, uvLen);
|
|
240
|
-
ib = this.parseUVIndex(ub, uvLen);
|
|
241
|
-
ic = this.parseUVIndex(uc, uvLen);
|
|
242
|
-
if (d === undefined) {
|
|
243
|
-
this.addUV(ia, ib, ic);
|
|
244
|
-
} else {
|
|
245
|
-
id = this.parseUVIndex(ud, uvLen);
|
|
246
|
-
this.addUV(ia, ib, id);
|
|
247
|
-
this.addUV(ib, ic, id);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
if (na !== undefined) {
|
|
251
|
-
// Normals are many times the same. If so, skip function call and parseInt.
|
|
252
|
-
var nLen = this.normals.length;
|
|
253
|
-
ia = this.parseNormalIndex(na, nLen);
|
|
254
|
-
ib = na === nb ? ia : this.parseNormalIndex(nb, nLen);
|
|
255
|
-
ic = na === nc ? ia : this.parseNormalIndex(nc, nLen);
|
|
256
|
-
if (d === undefined) {
|
|
257
|
-
this.addNormal(ia, ib, ic);
|
|
258
|
-
} else {
|
|
259
|
-
id = this.parseNormalIndex(nd, nLen);
|
|
260
|
-
this.addNormal(ia, ib, id);
|
|
261
|
-
this.addNormal(ib, ic, id);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
addLineGeometry: function addLineGeometry(vertices, uvs) {
|
|
266
|
-
this.object.geometry.type = 'Line';
|
|
267
|
-
var vLen = this.vertices.length;
|
|
268
|
-
var uvLen = this.uvs.length;
|
|
269
|
-
for (var vi = 0, l = vertices.length; vi < l; vi++) {
|
|
270
|
-
this.addVertexLine(this.parseVertexIndex(vertices[vi], vLen));
|
|
271
|
-
}
|
|
272
|
-
for (var uvi = 0, _l = uvs.length; uvi < _l; uvi++) {
|
|
273
|
-
this.addUVLine(this.parseUVIndex(uvs[uvi], uvLen));
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
state.startObject('', false);
|
|
278
|
-
return state;
|
|
279
|
-
},
|
|
280
|
-
parse: function parse(text) {
|
|
281
|
-
var state = this._createParserState();
|
|
282
|
-
if (text.indexOf('\r\n') !== -1) {
|
|
283
|
-
// This is faster than String.split with regex that splits on both
|
|
284
|
-
text = text.replace('\r\n', '\n');
|
|
285
|
-
}
|
|
286
|
-
var lines = text.split('\n');
|
|
287
|
-
var line = '',
|
|
288
|
-
lineFirstChar = '',
|
|
289
|
-
lineSecondChar = '';
|
|
290
|
-
var lineLength = 0;
|
|
291
|
-
var result = [];
|
|
292
|
-
|
|
293
|
-
// Faster to just trim left side of the line. Use if available.
|
|
294
|
-
var trimLeft = typeof ''.trimLeft === 'function';
|
|
295
|
-
for (var i = 0, l = lines.length; i < l; i++) {
|
|
296
|
-
line = lines[i];
|
|
297
|
-
line = trimLeft ? line.trimLeft() : line.trim();
|
|
298
|
-
lineLength = line.length;
|
|
299
|
-
if (lineLength === 0) continue;
|
|
300
|
-
lineFirstChar = line.charAt(0);
|
|
301
|
-
|
|
302
|
-
// @todo invoke passed in handler if any
|
|
303
|
-
if (lineFirstChar === '#') continue;
|
|
304
|
-
if (lineFirstChar === 'v') {
|
|
305
|
-
lineSecondChar = line.charAt(1);
|
|
306
|
-
if (lineSecondChar === ' ' && (result = this.regexp.vertex_pattern.exec(line)) !== null) {
|
|
307
|
-
// 0 1 2 3
|
|
308
|
-
// ["v 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
|
|
309
|
-
|
|
310
|
-
state.vertices.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));
|
|
311
|
-
} else if (lineSecondChar === 'n' && (result = this.regexp.normal_pattern.exec(line)) !== null) {
|
|
312
|
-
// 0 1 2 3
|
|
313
|
-
// ["vn 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
|
|
314
|
-
|
|
315
|
-
state.normals.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));
|
|
316
|
-
} else if (lineSecondChar === 't' && (result = this.regexp.uv_pattern.exec(line)) !== null) {
|
|
317
|
-
// 0 1 2
|
|
318
|
-
// ["vt 0.1 0.2", "0.1", "0.2"]
|
|
319
|
-
|
|
320
|
-
state.uvs.push(parseFloat(result[1]), parseFloat(result[2]));
|
|
321
|
-
} else {
|
|
322
|
-
throw new Error("Unexpected vertex/normal/uv line: '" + line + "'");
|
|
323
|
-
}
|
|
324
|
-
} else if (lineFirstChar === 'f') {
|
|
325
|
-
if ((result = this.regexp.face_vertex_uv_normal.exec(line)) !== null) {
|
|
326
|
-
// f vertex/uv/normal vertex/uv/normal vertex/uv/normal
|
|
327
|
-
// 0 1 2 3 4 5 6 7 8 9 10 11 12
|
|
328
|
-
// ["f 1/1/1 2/2/2 3/3/3", "1", "1", "1", "2", "2", "2", "3", "3", "3", undefined, undefined, undefined]
|
|
329
|
-
|
|
330
|
-
state.addFace(result[1], result[4], result[7], result[10], result[2], result[5], result[8], result[11], result[3], result[6], result[9], result[12]);
|
|
331
|
-
} else if ((result = this.regexp.face_vertex_uv.exec(line)) !== null) {
|
|
332
|
-
// f vertex/uv vertex/uv vertex/uv
|
|
333
|
-
// 0 1 2 3 4 5 6 7 8
|
|
334
|
-
// ["f 1/1 2/2 3/3", "1", "1", "2", "2", "3", "3", undefined, undefined]
|
|
335
|
-
|
|
336
|
-
state.addFace(result[1], result[3], result[5], result[7], result[2], result[4], result[6], result[8]);
|
|
337
|
-
} else if ((result = this.regexp.face_vertex_normal.exec(line)) !== null) {
|
|
338
|
-
// f vertex//normal vertex//normal vertex//normal
|
|
339
|
-
// 0 1 2 3 4 5 6 7 8
|
|
340
|
-
// ["f 1//1 2//2 3//3", "1", "1", "2", "2", "3", "3", undefined, undefined]
|
|
341
|
-
|
|
342
|
-
state.addFace(result[1], result[3], result[5], result[7], undefined, undefined, undefined, undefined, result[2], result[4], result[6], result[8]);
|
|
343
|
-
} else if ((result = this.regexp.face_vertex.exec(line)) !== null) {
|
|
344
|
-
// f vertex vertex vertex
|
|
345
|
-
// 0 1 2 3 4
|
|
346
|
-
// ["f 1 2 3", "1", "2", "3", undefined]
|
|
347
|
-
|
|
348
|
-
state.addFace(result[1], result[2], result[3], result[4]);
|
|
349
|
-
} else {
|
|
350
|
-
throw new Error("Unexpected face line: '" + line + "'");
|
|
351
|
-
}
|
|
352
|
-
} else if (lineFirstChar === 'l') {
|
|
353
|
-
var lineParts = line.substring(1).trim().split(' ');
|
|
354
|
-
var lineVertices = [],
|
|
355
|
-
lineUVs = [];
|
|
356
|
-
if (line.indexOf('/') === -1) {
|
|
357
|
-
lineVertices = lineParts;
|
|
358
|
-
} else {
|
|
359
|
-
for (var li = 0, llen = lineParts.length; li < llen; li++) {
|
|
360
|
-
var parts = lineParts[li].split('/');
|
|
361
|
-
if (parts[0] !== '') lineVertices.push(parts[0]);
|
|
362
|
-
if (parts[1] !== '') lineUVs.push(parts[1]);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
state.addLineGeometry(lineVertices, lineUVs);
|
|
366
|
-
} else if ((result = this.regexp.object_pattern.exec(line)) !== null) {
|
|
367
|
-
// o object_name
|
|
368
|
-
// or
|
|
369
|
-
// g group_name
|
|
370
|
-
|
|
371
|
-
var name = result[0].substr(1).trim();
|
|
372
|
-
state.startObject(name);
|
|
373
|
-
} else if (this.regexp.material_use_pattern.test(line)) {
|
|
374
|
-
// material
|
|
375
|
-
|
|
376
|
-
state.object.startMaterial(line.substring(7).trim(), state.materialLibraries);
|
|
377
|
-
} else if (this.regexp.material_library_pattern.test(line)) {
|
|
378
|
-
// mtl file
|
|
379
|
-
|
|
380
|
-
state.materialLibraries.push(line.substring(7).trim());
|
|
381
|
-
} else if ((result = this.regexp.smoothing_pattern.exec(line)) !== null) {
|
|
382
|
-
// smooth shading
|
|
383
|
-
|
|
384
|
-
// @todo Handle files that have varying smooth values for a set of faces inside one geometry,
|
|
385
|
-
// but does not define a usemtl for each face set.
|
|
386
|
-
// This should be detected and a dummy material created (later MultiMaterial and geometry groups).
|
|
387
|
-
// This requires some care to not create extra material on each smooth value for "normal" obj files.
|
|
388
|
-
// where explicit usemtl defines geometry groups.
|
|
389
|
-
// Example asset: examples/models/obj/cerberus/Cerberus.obj
|
|
390
|
-
|
|
391
|
-
var value = result[1].trim().toLowerCase();
|
|
392
|
-
state.object.smooth = value === '1' || value === 'on';
|
|
393
|
-
var material = state.object.currentMaterial();
|
|
394
|
-
if (material) {
|
|
395
|
-
material.smooth = state.object.smooth;
|
|
396
|
-
}
|
|
397
|
-
} else {
|
|
398
|
-
// Handle null terminated files without exception
|
|
399
|
-
if (line === '\0') continue;
|
|
400
|
-
throw new Error("Unexpected line: '" + line + "'");
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
state.finalize();
|
|
404
|
-
var container = new THREE.Group();
|
|
405
|
-
container.materialLibraries = [].concat(state.materialLibraries);
|
|
406
|
-
for (var _i = 0, _l2 = state.objects.length; _i < _l2; _i++) {
|
|
407
|
-
var object = state.objects[_i];
|
|
408
|
-
var geometry = object.geometry;
|
|
409
|
-
var materials = object.materials;
|
|
410
|
-
var isLine = geometry.type === 'Line';
|
|
411
|
-
|
|
412
|
-
// Skip o/g line declarations that did not follow with any faces
|
|
413
|
-
if (geometry.vertices.length === 0) continue;
|
|
414
|
-
var buffergeometry = new THREE.BufferGeometry();
|
|
415
|
-
buffergeometry.addAttribute('position', new THREE.BufferAttribute(new Float32Array(geometry.vertices), 3));
|
|
416
|
-
if (geometry.normals.length > 0) {
|
|
417
|
-
buffergeometry.addAttribute('normal', new THREE.BufferAttribute(new Float32Array(geometry.normals), 3));
|
|
418
|
-
} else {
|
|
419
|
-
buffergeometry.computeVertexNormals();
|
|
420
|
-
}
|
|
421
|
-
if (geometry.uvs.length > 0) {
|
|
422
|
-
buffergeometry.addAttribute('uv', new THREE.BufferAttribute(new Float32Array(geometry.uvs), 2));
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
// Create materials
|
|
426
|
-
|
|
427
|
-
var createdMaterials = [];
|
|
428
|
-
for (var mi = 0, miLen = materials.length; mi < miLen; mi++) {
|
|
429
|
-
var sourceMaterial = materials[mi];
|
|
430
|
-
var _material = undefined;
|
|
431
|
-
if (this.materials !== null) {
|
|
432
|
-
_material = this.materials.create(sourceMaterial.name);
|
|
433
|
-
|
|
434
|
-
// mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.
|
|
435
|
-
if (isLine && _material && !(_material instanceof THREE.LineBasicMaterial)) {
|
|
436
|
-
var materialLine = new THREE.LineBasicMaterial();
|
|
437
|
-
materialLine.copy(_material);
|
|
438
|
-
_material = materialLine;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
if (!_material) {
|
|
442
|
-
_material = !isLine ? new THREE.MeshPhongMaterial() : new THREE.LineBasicMaterial();
|
|
443
|
-
_material.name = sourceMaterial.name;
|
|
444
|
-
}
|
|
445
|
-
if (!sourceMaterial.smooth) _material.flatShading = true;
|
|
446
|
-
createdMaterials.push(_material);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
// Create mesh
|
|
450
|
-
|
|
451
|
-
var mesh = void 0;
|
|
452
|
-
if (createdMaterials.length > 1) {
|
|
453
|
-
for (var _mi = 0, _miLen = materials.length; _mi < _miLen; _mi++) {
|
|
454
|
-
var _sourceMaterial = materials[_mi];
|
|
455
|
-
buffergeometry.addGroup(_sourceMaterial.groupStart, _sourceMaterial.groupCount, _mi);
|
|
456
|
-
}
|
|
457
|
-
var multiMaterial = new THREE.MultiMaterial(createdMaterials);
|
|
458
|
-
mesh = !isLine ? new THREE.Mesh(buffergeometry, multiMaterial) : new THREE.Line(buffergeometry, multiMaterial);
|
|
459
|
-
} else {
|
|
460
|
-
mesh = !isLine ? new THREE.Mesh(buffergeometry, createdMaterials[0]) : new THREE.Line(buffergeometry, createdMaterials[0]);
|
|
461
|
-
}
|
|
462
|
-
mesh.name = object.name;
|
|
463
|
-
container.add(mesh);
|
|
464
|
-
}
|
|
465
|
-
return container;
|
|
466
|
-
}
|
|
467
|
-
};
|
|
468
|
-
var _default = exports["default"] = OBJLoader;
|