@babylonjs/loaders 5.0.0-beta.6 → 5.0.0-beta.8-snapshot
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +20 -198
- package/OBJ/index.d.ts +0 -4
- package/OBJ/index.js +0 -5
- package/OBJ/index.js.map +0 -1
- package/OBJ/mtlFileLoader.d.ts +0 -40
- package/OBJ/mtlFileLoader.js +0 -222
- package/OBJ/mtlFileLoader.js.map +0 -1
- package/OBJ/objFileLoader.d.ts +0 -133
- package/OBJ/objFileLoader.js +0 -301
- package/OBJ/objFileLoader.js.map +0 -1
- package/OBJ/objLoadingOptions.d.ts +0 -43
- package/OBJ/objLoadingOptions.js +0 -2
- package/OBJ/objLoadingOptions.js.map +0 -1
- package/OBJ/solidParser.d.ts +0 -153
- package/OBJ/solidParser.js +0 -700
- package/OBJ/solidParser.js.map +0 -1
- package/STL/index.d.ts +0 -1
- package/STL/index.js +0 -2
- package/STL/index.js.map +0 -1
- package/STL/stlFileLoader.d.ts +0 -71
- package/STL/stlFileLoader.js +0 -240
- package/STL/stlFileLoader.js.map +0 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +0 -13
- package/glTF/1.0/glTFBinaryExtension.js +0 -62
- package/glTF/1.0/glTFBinaryExtension.js.map +0 -1
- package/glTF/1.0/glTFLoader.d.ts +0 -106
- package/glTF/1.0/glTFLoader.js +0 -1697
- package/glTF/1.0/glTFLoader.js.map +0 -1
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +0 -412
- package/glTF/1.0/glTFLoaderInterfaces.js +0 -96
- package/glTF/1.0/glTFLoaderInterfaces.js.map +0 -1
- package/glTF/1.0/glTFLoaderUtils.d.ts +0 -62
- package/glTF/1.0/glTFLoaderUtils.js +0 -233
- package/glTF/1.0/glTFLoaderUtils.js.map +0 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +0 -10
- package/glTF/1.0/glTFMaterialsCommonExtension.js +0 -128
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +0 -1
- package/glTF/1.0/index.d.ts +0 -5
- package/glTF/1.0/index.js +0 -6
- package/glTF/1.0/index.js.map +0 -1
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +0 -36
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +0 -111
- package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +0 -1
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +0 -27
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +0 -80
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +0 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +0 -27
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +0 -43
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +0 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +0 -21
- package/glTF/2.0/Extensions/EXT_texture_webp.js +0 -33
- package/glTF/2.0/Extensions/EXT_texture_webp.js.map +0 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +0 -32
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +0 -56
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +0 -102
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +0 -28
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +0 -82
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +0 -87
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +0 -46
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +0 -34
- package/glTF/2.0/Extensions/KHR_materials_ior.js +0 -55
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +0 -73
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +0 -77
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_specular.js +0 -67
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +0 -77
- package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +0 -278
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +0 -66
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +0 -76
- package/glTF/2.0/Extensions/KHR_materials_variants.js +0 -244
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_materials_volume.js +0 -79
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +0 -19
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +0 -22
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +0 -21
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +0 -33
- package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +0 -25
- package/glTF/2.0/Extensions/KHR_texture_transform.js +0 -54
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +0 -29
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +0 -47
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +0 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +0 -38
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +0 -217
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +0 -1
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +0 -75
- package/glTF/2.0/Extensions/MSFT_lod.js +0 -334
- package/glTF/2.0/Extensions/MSFT_lod.js.map +0 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +0 -14
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +0 -37
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +0 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +0 -14
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +0 -37
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +0 -1
- package/glTF/2.0/Extensions/index.d.ts +0 -26
- package/glTF/2.0/Extensions/index.js +0 -27
- package/glTF/2.0/Extensions/index.js.map +0 -1
- package/glTF/2.0/glTFLoader.d.ts +0 -355
- package/glTF/2.0/glTFLoader.js +0 -2184
- package/glTF/2.0/glTFLoader.js.map +0 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +0 -152
- package/glTF/2.0/glTFLoaderExtension.js +0 -2
- package/glTF/2.0/glTFLoaderExtension.js.map +0 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +0 -212
- package/glTF/2.0/glTFLoaderInterfaces.js +0 -2
- package/glTF/2.0/glTFLoaderInterfaces.js.map +0 -1
- package/glTF/2.0/index.d.ts +0 -4
- package/glTF/2.0/index.js +0 -5
- package/glTF/2.0/index.js.map +0 -1
- package/glTF/glTFFileLoader.d.ts +0 -364
- package/glTF/glTFFileLoader.js +0 -865
- package/glTF/glTFFileLoader.js.map +0 -1
- package/glTF/glTFValidation.d.ts +0 -29
- package/glTF/glTFValidation.js +0 -122
- package/glTF/glTFValidation.js.map +0 -1
- package/glTF/index.d.ts +0 -5
- package/glTF/index.js +0 -6
- package/glTF/index.js.map +0 -1
- package/index.d.ts +0 -3
- package/index.js.map +0 -1
- package/legacy/legacy-glTF.d.ts +0 -2
- package/legacy/legacy-glTF.js +0 -19
- package/legacy/legacy-glTF.js.map +0 -1
- package/legacy/legacy-glTF1.d.ts +0 -2
- package/legacy/legacy-glTF1.js +0 -15
- package/legacy/legacy-glTF1.js.map +0 -1
- package/legacy/legacy-glTF1FileLoader.d.ts +0 -2
- package/legacy/legacy-glTF1FileLoader.js +0 -3
- package/legacy/legacy-glTF1FileLoader.js.map +0 -1
- package/legacy/legacy-glTF2.d.ts +0 -2
- package/legacy/legacy-glTF2.js +0 -33
- package/legacy/legacy-glTF2.js.map +0 -1
- package/legacy/legacy-glTF2FileLoader.d.ts +0 -2
- package/legacy/legacy-glTF2FileLoader.js +0 -3
- package/legacy/legacy-glTF2FileLoader.js.map +0 -1
- package/legacy/legacy-glTFFileLoader.d.ts +0 -3
- package/legacy/legacy-glTFFileLoader.js +0 -4
- package/legacy/legacy-glTFFileLoader.js.map +0 -1
- package/legacy/legacy-objFileLoader.d.ts +0 -1
- package/legacy/legacy-objFileLoader.js +0 -13
- package/legacy/legacy-objFileLoader.js.map +0 -1
- package/legacy/legacy-stlFileLoader.d.ts +0 -1
- package/legacy/legacy-stlFileLoader.js +0 -13
- package/legacy/legacy-stlFileLoader.js.map +0 -1
- package/legacy/legacy.d.ts +0 -6
- package/legacy/legacy.js +0 -7
- package/legacy/legacy.js.map +0 -1
- package/readme.md +0 -24
package/OBJ/solidParser.d.ts
DELETED
@@ -1,153 +0,0 @@
|
|
1
|
-
import { AssetContainer } from "@babylonjs/core/assetContainer";
|
2
|
-
import { Mesh } from "@babylonjs/core/Meshes/mesh";
|
3
|
-
import { Scene } from "@babylonjs/core/scene";
|
4
|
-
import { Nullable } from "@babylonjs/core/types";
|
5
|
-
import { OBJLoadingOptions } from "./objLoadingOptions";
|
6
|
-
/**
|
7
|
-
* Class used to load mesh data from OBJ content
|
8
|
-
*/
|
9
|
-
export declare class SolidParser {
|
10
|
-
/** Object descriptor */
|
11
|
-
static ObjectDescriptor: RegExp;
|
12
|
-
/** Group descriptor */
|
13
|
-
static GroupDescriptor: RegExp;
|
14
|
-
/** Material lib descriptor */
|
15
|
-
static MtlLibGroupDescriptor: RegExp;
|
16
|
-
/** Use a material descriptor */
|
17
|
-
static UseMtlDescriptor: RegExp;
|
18
|
-
/** Smooth descriptor */
|
19
|
-
static SmoothDescriptor: RegExp;
|
20
|
-
/** Pattern used to detect a vertex */
|
21
|
-
static VertexPattern: RegExp;
|
22
|
-
/** Pattern used to detect a normal */
|
23
|
-
static NormalPattern: RegExp;
|
24
|
-
/** Pattern used to detect a UV set */
|
25
|
-
static UVPattern: RegExp;
|
26
|
-
/** Pattern used to detect a first kind of face (f vertex vertex vertex) */
|
27
|
-
static FacePattern1: RegExp;
|
28
|
-
/** Pattern used to detect a second kind of face (f vertex/uvs vertex/uvs vertex/uvs) */
|
29
|
-
static FacePattern2: RegExp;
|
30
|
-
/** Pattern used to detect a third kind of face (f vertex/uvs/normal vertex/uvs/normal vertex/uvs/normal) */
|
31
|
-
static FacePattern3: RegExp;
|
32
|
-
/** Pattern used to detect a fourth kind of face (f vertex//normal vertex//normal vertex//normal)*/
|
33
|
-
static FacePattern4: RegExp;
|
34
|
-
/** Pattern used to detect a fifth kind of face (f -vertex/-uvs/-normal -vertex/-uvs/-normal -vertex/-uvs/-normal) */
|
35
|
-
static FacePattern5: RegExp;
|
36
|
-
private _loadingOptions;
|
37
|
-
private _positions;
|
38
|
-
private _normals;
|
39
|
-
private _uvs;
|
40
|
-
private _colors;
|
41
|
-
private _meshesFromObj;
|
42
|
-
private _handledMesh;
|
43
|
-
private _indicesForBabylon;
|
44
|
-
private _wrappedPositionForBabylon;
|
45
|
-
private _wrappedUvsForBabylon;
|
46
|
-
private _wrappedColorsForBabylon;
|
47
|
-
private _wrappedNormalsForBabylon;
|
48
|
-
private _tuplePosNorm;
|
49
|
-
private _curPositionInIndices;
|
50
|
-
private _hasMeshes;
|
51
|
-
private _unwrappedPositionsForBabylon;
|
52
|
-
private _unwrappedColorsForBabylon;
|
53
|
-
private _unwrappedNormalsForBabylon;
|
54
|
-
private _unwrappedUVForBabylon;
|
55
|
-
private _triangles;
|
56
|
-
private _materialNameFromObj;
|
57
|
-
private _objMeshName;
|
58
|
-
private _increment;
|
59
|
-
private _isFirstMaterial;
|
60
|
-
private _grayColor;
|
61
|
-
private _materialToUse;
|
62
|
-
private _babylonMeshesArray;
|
63
|
-
/**
|
64
|
-
* Creates a new SolidParser
|
65
|
-
* @param materialToUse defines the array to fill with the list of materials to use (it will be filled by the parse function)
|
66
|
-
* @param babylonMeshesArray defines the array to fill with the list of loaded meshes (it will be filled by the parse function)
|
67
|
-
* @param loadingOptions defines the loading options to use
|
68
|
-
*/
|
69
|
-
constructor(materialToUse: string[], babylonMeshesArray: Array<Mesh>, loadingOptions: OBJLoadingOptions);
|
70
|
-
/**
|
71
|
-
* Search for obj in the given array.
|
72
|
-
* This function is called to check if a couple of data already exists in an array.
|
73
|
-
*
|
74
|
-
* If found, returns the index of the founded tuple index. Returns -1 if not found
|
75
|
-
* @param arr Array<{ normals: Array<number>, idx: Array<number> }>
|
76
|
-
* @param obj Array<number>
|
77
|
-
* @returns {boolean}
|
78
|
-
*/
|
79
|
-
private _isInArray;
|
80
|
-
private _isInArrayUV;
|
81
|
-
/**
|
82
|
-
* This function set the data for each triangle.
|
83
|
-
* Data are position, normals and uvs
|
84
|
-
* If a tuple of (position, normal) is not set, add the data into the corresponding array
|
85
|
-
* If the tuple already exist, add only their indice
|
86
|
-
*
|
87
|
-
* @param indicePositionFromObj Integer The index in positions array
|
88
|
-
* @param indiceUvsFromObj Integer The index in uvs array
|
89
|
-
* @param indiceNormalFromObj Integer The index in normals array
|
90
|
-
* @param positionVectorFromOBJ Vector3 The value of position at index objIndice
|
91
|
-
* @param textureVectorFromOBJ Vector3 The value of uvs
|
92
|
-
* @param normalsVectorFromOBJ Vector3 The value of normals at index objNormale
|
93
|
-
*/
|
94
|
-
private _setData;
|
95
|
-
/**
|
96
|
-
* Transform Vector() and BABYLON.Color() objects into numbers in an array
|
97
|
-
*/
|
98
|
-
private _unwrapData;
|
99
|
-
/**
|
100
|
-
* Create triangles from polygons
|
101
|
-
* It is important to notice that a triangle is a polygon
|
102
|
-
* We get 5 patterns of face defined in OBJ File :
|
103
|
-
* facePattern1 = ["1","2","3","4","5","6"]
|
104
|
-
* facePattern2 = ["1/1","2/2","3/3","4/4","5/5","6/6"]
|
105
|
-
* facePattern3 = ["1/1/1","2/2/2","3/3/3","4/4/4","5/5/5","6/6/6"]
|
106
|
-
* facePattern4 = ["1//1","2//2","3//3","4//4","5//5","6//6"]
|
107
|
-
* facePattern5 = ["-1/-1/-1","-2/-2/-2","-3/-3/-3","-4/-4/-4","-5/-5/-5","-6/-6/-6"]
|
108
|
-
* Each pattern is divided by the same method
|
109
|
-
* @param face Array[String] The indices of elements
|
110
|
-
* @param v Integer The variable to increment
|
111
|
-
*/
|
112
|
-
private _getTriangles;
|
113
|
-
/**
|
114
|
-
* Create triangles and push the data for each polygon for the pattern 1
|
115
|
-
* In this pattern we get vertice positions
|
116
|
-
* @param face
|
117
|
-
* @param v
|
118
|
-
*/
|
119
|
-
private _setDataForCurrentFaceWithPattern1;
|
120
|
-
/**
|
121
|
-
* Create triangles and push the data for each polygon for the pattern 2
|
122
|
-
* In this pattern we get vertice positions and uvsu
|
123
|
-
* @param face
|
124
|
-
* @param v
|
125
|
-
*/
|
126
|
-
private _setDataForCurrentFaceWithPattern2;
|
127
|
-
/**
|
128
|
-
* Create triangles and push the data for each polygon for the pattern 3
|
129
|
-
* In this pattern we get vertice positions, uvs and normals
|
130
|
-
* @param face
|
131
|
-
* @param v
|
132
|
-
*/
|
133
|
-
private _setDataForCurrentFaceWithPattern3;
|
134
|
-
/**
|
135
|
-
* Create triangles and push the data for each polygon for the pattern 4
|
136
|
-
* In this pattern we get vertice positions and normals
|
137
|
-
* @param face
|
138
|
-
* @param v
|
139
|
-
*/
|
140
|
-
private _setDataForCurrentFaceWithPattern4;
|
141
|
-
private _setDataForCurrentFaceWithPattern5;
|
142
|
-
private _addPreviousObjMesh;
|
143
|
-
private _optimizeNormals;
|
144
|
-
/**
|
145
|
-
* Function used to parse an OBJ string
|
146
|
-
* @param meshesNames defines the list of meshes to load (all if not defined)
|
147
|
-
* @param data defines the OBJ string
|
148
|
-
* @param scene defines the hosting scene
|
149
|
-
* @param assetContainer defines the asset container to load data in
|
150
|
-
* @param onFileToLoadFound defines a callback that will be called if a MTL file is found
|
151
|
-
*/
|
152
|
-
parse(meshesNames: any, data: string, scene: Scene, assetContainer: Nullable<AssetContainer>, onFileToLoadFound: (fileToLoad: string) => void): void;
|
153
|
-
}
|