|
@@ -448,8 +448,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLTFLoader", function() { return GLTFLoader; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLTFLoader", function() { return GLTFLoader; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLTFLoaderExtension", function() { return GLTFLoaderExtension; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLTFLoaderExtension", function() { return GLTFLoaderExtension; });
|
|
/* harmony import */ var _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./glTFLoaderInterfaces */ "./glTF/1.0/glTFLoaderInterfaces.ts");
|
|
/* harmony import */ var _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./glTFLoaderInterfaces */ "./glTF/1.0/glTFLoaderInterfaces.ts");
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
|
|
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math.vector */ "babylonjs/Misc/tools");
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _glTFLoaderUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./glTFLoaderUtils */ "./glTF/1.0/glTFLoaderUtils.ts");
|
|
/* harmony import */ var _glTFLoaderUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./glTFLoaderUtils */ "./glTF/1.0/glTFLoaderUtils.ts");
|
|
/* harmony import */ var _glTFFileLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../glTFFileLoader */ "./glTF/glTFFileLoader.ts");
|
|
/* harmony import */ var _glTFFileLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../glTFFileLoader */ "./glTF/glTFFileLoader.ts");
|
|
|
|
|
|
@@ -479,6 +479,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Tokenizer. Used for shaders compatibility
|
|
* Tokenizer. Used for shaders compatibility
|
|
* Automatically map world, view, projection, worldViewProjection, attributes and so on
|
|
* Automatically map world, view, projection, worldViewProjection, attributes and so on
|
|
@@ -627,10 +628,10 @@ var loadAnimations = function (gltfRuntime) {
|
|
targetNode = gltfRuntime.scene.getNodeByName(targetID);
|
|
targetNode = gltfRuntime.scene.getNodeByName(targetID);
|
|
}
|
|
}
|
|
if (targetNode === null) {
|
|
if (targetNode === null) {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Creating animation named " + anim + ". But cannot find node named " + targetID + " to attach to");
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Creating animation named " + anim + ". But cannot find node named " + targetID + " to attach to");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- var isBone = targetNode instanceof babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Bone"];
|
|
|
|
|
|
+ var isBone = targetNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Bone"];
|
|
// Get target path (position, rotation or scaling)
|
|
// Get target path (position, rotation or scaling)
|
|
var targetPath = channel.target.path;
|
|
var targetPath = channel.target.path;
|
|
var targetPathIndex = glTFAnimationPaths.indexOf(targetPath);
|
|
var targetPathIndex = glTFAnimationPaths.indexOf(targetPath);
|
|
@@ -638,14 +639,14 @@ var loadAnimations = function (gltfRuntime) {
|
|
targetPath = babylonAnimationPaths[targetPathIndex];
|
|
targetPath = babylonAnimationPaths[targetPathIndex];
|
|
}
|
|
}
|
|
// Determine animation type
|
|
// Determine animation type
|
|
- var animationType = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Animation"].ANIMATIONTYPE_MATRIX;
|
|
|
|
|
|
+ var animationType = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Animation"].ANIMATIONTYPE_MATRIX;
|
|
if (!isBone) {
|
|
if (!isBone) {
|
|
if (targetPath === "rotationQuaternion") {
|
|
if (targetPath === "rotationQuaternion") {
|
|
- animationType = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Animation"].ANIMATIONTYPE_QUATERNION;
|
|
|
|
- targetNode.rotationQuaternion = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Quaternion"]();
|
|
|
|
|
|
+ animationType = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Animation"].ANIMATIONTYPE_QUATERNION;
|
|
|
|
+ targetNode.rotationQuaternion = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Quaternion"]();
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- animationType = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Animation"].ANIMATIONTYPE_VECTOR3;
|
|
|
|
|
|
+ animationType = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Animation"].ANIMATIONTYPE_VECTOR3;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// Create animation and key frames
|
|
// Create animation and key frames
|
|
@@ -659,25 +660,25 @@ var loadAnimations = function (gltfRuntime) {
|
|
}
|
|
}
|
|
if (!modifyKey) {
|
|
if (!modifyKey) {
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
- babylonAnimation = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Animation"](anim, isBone ? "_matrix" : targetPath, 1, animationType, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Animation"].ANIMATIONLOOPMODE_CYCLE);
|
|
|
|
|
|
+ babylonAnimation = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Animation"](anim, isBone ? "_matrix" : targetPath, 1, animationType, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Animation"].ANIMATIONLOOPMODE_CYCLE);
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
}
|
|
}
|
|
// For each frame
|
|
// For each frame
|
|
for (var j = 0; j < bufferInput.length; j++) {
|
|
for (var j = 0; j < bufferInput.length; j++) {
|
|
var value = null;
|
|
var value = null;
|
|
if (targetPath === "rotationQuaternion") { // VEC4
|
|
if (targetPath === "rotationQuaternion") { // VEC4
|
|
- value = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromArray([bufferOutput[arrayOffset], bufferOutput[arrayOffset + 1], bufferOutput[arrayOffset + 2], bufferOutput[arrayOffset + 3]]);
|
|
|
|
|
|
+ value = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromArray([bufferOutput[arrayOffset], bufferOutput[arrayOffset + 1], bufferOutput[arrayOffset + 2], bufferOutput[arrayOffset + 3]]);
|
|
arrayOffset += 4;
|
|
arrayOffset += 4;
|
|
}
|
|
}
|
|
else { // Position and scaling are VEC3
|
|
else { // Position and scaling are VEC3
|
|
- value = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray([bufferOutput[arrayOffset], bufferOutput[arrayOffset + 1], bufferOutput[arrayOffset + 2]]);
|
|
|
|
|
|
+ value = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray([bufferOutput[arrayOffset], bufferOutput[arrayOffset + 1], bufferOutput[arrayOffset + 2]]);
|
|
arrayOffset += 3;
|
|
arrayOffset += 3;
|
|
}
|
|
}
|
|
if (isBone) {
|
|
if (isBone) {
|
|
var bone = targetNode;
|
|
var bone = targetNode;
|
|
- var translation = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();
|
|
|
|
- var rotationQuaternion = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Quaternion"]();
|
|
|
|
- var scaling = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();
|
|
|
|
|
|
+ var translation = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();
|
|
|
|
+ var rotationQuaternion = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Quaternion"]();
|
|
|
|
+ var scaling = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();
|
|
// Warning on decompose
|
|
// Warning on decompose
|
|
var mat = bone.getBaseMatrix();
|
|
var mat = bone.getBaseMatrix();
|
|
if (modifyKey && lastAnimation) {
|
|
if (modifyKey && lastAnimation) {
|
|
@@ -693,7 +694,7 @@ var loadAnimations = function (gltfRuntime) {
|
|
else {
|
|
else {
|
|
scaling = value;
|
|
scaling = value;
|
|
}
|
|
}
|
|
- value = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Compose(scaling, rotationQuaternion, translation);
|
|
|
|
|
|
+ value = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Compose(scaling, rotationQuaternion, translation);
|
|
}
|
|
}
|
|
if (!modifyKey) {
|
|
if (!modifyKey) {
|
|
keys.push({
|
|
keys.push({
|
|
@@ -722,13 +723,13 @@ var loadAnimations = function (gltfRuntime) {
|
|
var configureBoneTransformation = function (node) {
|
|
var configureBoneTransformation = function (node) {
|
|
var mat = null;
|
|
var mat = null;
|
|
if (node.translation || node.rotation || node.scale) {
|
|
if (node.translation || node.rotation || node.scale) {
|
|
- var scale = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(node.scale || [1, 1, 1]);
|
|
|
|
- var rotation = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromArray(node.rotation || [0, 0, 0, 1]);
|
|
|
|
- var position = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(node.translation || [0, 0, 0]);
|
|
|
|
- mat = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Compose(scale, rotation, position);
|
|
|
|
|
|
+ var scale = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(node.scale || [1, 1, 1]);
|
|
|
|
+ var rotation = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromArray(node.rotation || [0, 0, 0, 1]);
|
|
|
|
+ var position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(node.translation || [0, 0, 0]);
|
|
|
|
+ mat = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Compose(scale, rotation, position);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- mat = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Matrix"].FromArray(node.matrix);
|
|
|
|
|
|
+ mat = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Matrix"].FromArray(node.matrix);
|
|
}
|
|
}
|
|
return mat;
|
|
return mat;
|
|
};
|
|
};
|
|
@@ -757,7 +758,7 @@ var getParentBone = function (gltfRuntime, skins, jointName, newSkeleton) {
|
|
}
|
|
}
|
|
if (child.jointName === jointName) {
|
|
if (child.jointName === jointName) {
|
|
var mat = configureBoneTransformation(node);
|
|
var mat = configureBoneTransformation(node);
|
|
- var bone = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Bone"](node.name || "", newSkeleton, getParentBone(gltfRuntime, skins, node.jointName, newSkeleton), mat);
|
|
|
|
|
|
+ var bone = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Bone"](node.name || "", newSkeleton, getParentBone(gltfRuntime, skins, node.jointName, newSkeleton), mat);
|
|
bone.id = nde;
|
|
bone.id = nde;
|
|
return bone;
|
|
return bone;
|
|
}
|
|
}
|
|
@@ -827,7 +828,7 @@ var getNodesToRoot = function (gltfRuntime, newSkeleton, skins, nodesToRoot) {
|
|
}
|
|
}
|
|
// Create node to root bone
|
|
// Create node to root bone
|
|
var mat = configureBoneTransformation(node);
|
|
var mat = configureBoneTransformation(node);
|
|
- var bone = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Bone"](node.name || "", newSkeleton, null, mat);
|
|
|
|
|
|
+ var bone = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Bone"](node.name || "", newSkeleton, null, mat);
|
|
bone.id = id;
|
|
bone.id = id;
|
|
nodesToRoot.push({ bone: bone, node: node, id: id });
|
|
nodesToRoot.push({ bone: bone, node: node, id: id });
|
|
}
|
|
}
|
|
@@ -855,7 +856,7 @@ var getNodesToRoot = function (gltfRuntime, newSkeleton, skins, nodesToRoot) {
|
|
*/
|
|
*/
|
|
var importSkeleton = function (gltfRuntime, skins, mesh, newSkeleton, id) {
|
|
var importSkeleton = function (gltfRuntime, skins, mesh, newSkeleton, id) {
|
|
if (!newSkeleton) {
|
|
if (!newSkeleton) {
|
|
- newSkeleton = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Skeleton"](skins.name || "", "", gltfRuntime.scene);
|
|
|
|
|
|
+ newSkeleton = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Skeleton"](skins.name || "", "", gltfRuntime.scene);
|
|
}
|
|
}
|
|
if (!skins.babylonSkeleton) {
|
|
if (!skins.babylonSkeleton) {
|
|
return newSkeleton;
|
|
return newSkeleton;
|
|
@@ -873,7 +874,7 @@ var importSkeleton = function (gltfRuntime, skins, mesh, newSkeleton, id) {
|
|
}
|
|
}
|
|
var node = jointNode.node;
|
|
var node = jointNode.node;
|
|
if (!node) {
|
|
if (!node) {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Joint named " + skins.jointNames[i] + " does not exist");
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Joint named " + skins.jointNames[i] + " does not exist");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
var id = jointNode.id;
|
|
var id = jointNode.id;
|
|
@@ -893,7 +894,7 @@ var importSkeleton = function (gltfRuntime, skins, mesh, newSkeleton, id) {
|
|
}
|
|
}
|
|
var joint = jointNode_1.node;
|
|
var joint = jointNode_1.node;
|
|
if (!joint) {
|
|
if (!joint) {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Joint named " + skins.jointNames[j] + " does not exist when looking for parent");
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Joint named " + skins.jointNames[j] + " does not exist when looking for parent");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
var children = joint.children;
|
|
var children = joint.children;
|
|
@@ -922,7 +923,7 @@ var importSkeleton = function (gltfRuntime, skins, mesh, newSkeleton, id) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- var bone = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Bone"](node.jointName || "", newSkeleton, parentBone, mat);
|
|
|
|
|
|
+ var bone = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Bone"](node.jointName || "", newSkeleton, parentBone, mat);
|
|
bone.id = id;
|
|
bone.id = id;
|
|
}
|
|
}
|
|
// Polish
|
|
// Polish
|
|
@@ -953,7 +954,7 @@ var importSkeleton = function (gltfRuntime, skins, mesh, newSkeleton, id) {
|
|
var importMesh = function (gltfRuntime, node, meshes, id, newMesh) {
|
|
var importMesh = function (gltfRuntime, node, meshes, id, newMesh) {
|
|
if (!newMesh) {
|
|
if (!newMesh) {
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
- newMesh = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Mesh"](node.name || "", gltfRuntime.scene);
|
|
|
|
|
|
+ newMesh = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Mesh"](node.name || "", gltfRuntime.scene);
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
newMesh.id = id;
|
|
newMesh.id = id;
|
|
}
|
|
}
|
|
@@ -975,7 +976,7 @@ var importMesh = function (gltfRuntime, node, meshes, id, newMesh) {
|
|
// Positions, normals and UVs
|
|
// Positions, normals and UVs
|
|
for (var i = 0; i < mesh.primitives.length; i++) {
|
|
for (var i = 0; i < mesh.primitives.length; i++) {
|
|
// Temporary vertex data
|
|
// Temporary vertex data
|
|
- var tempVertexData = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["VertexData"]();
|
|
|
|
|
|
+ var tempVertexData = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexData"]();
|
|
var primitive = mesh.primitives[i];
|
|
var primitive = mesh.primitives[i];
|
|
if (primitive.mode !== 4) {
|
|
if (primitive.mode !== 4) {
|
|
// continue;
|
|
// continue;
|
|
@@ -1009,7 +1010,7 @@ var importMesh = function (gltfRuntime, node, meshes, id, newMesh) {
|
|
}
|
|
}
|
|
else if (semantic.indexOf("TEXCOORD_") !== -1) {
|
|
else if (semantic.indexOf("TEXCOORD_") !== -1) {
|
|
var channel = Number(semantic.split("_")[1]);
|
|
var channel = Number(semantic.split("_")[1]);
|
|
- var uvKind = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind + (channel === 0 ? "" : (channel + 1));
|
|
|
|
|
|
+ var uvKind = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind + (channel === 0 ? "" : (channel + 1));
|
|
var uvs = new Float32Array(buffer.length);
|
|
var uvs = new Float32Array(buffer.length);
|
|
uvs.set(buffer);
|
|
uvs.set(buffer);
|
|
normalizeUVs(uvs);
|
|
normalizeUVs(uvs);
|
|
@@ -1062,11 +1063,11 @@ var importMesh = function (gltfRuntime, node, meshes, id, newMesh) {
|
|
var material;
|
|
var material;
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
if (subMaterials.length > 1) {
|
|
if (subMaterials.length > 1) {
|
|
- material = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["MultiMaterial"]("multimat" + id, gltfRuntime.scene);
|
|
|
|
|
|
+ material = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["MultiMaterial"]("multimat" + id, gltfRuntime.scene);
|
|
material.subMaterials = subMaterials;
|
|
material.subMaterials = subMaterials;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- material = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]("multimat" + id, gltfRuntime.scene);
|
|
|
|
|
|
+ material = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]("multimat" + id, gltfRuntime.scene);
|
|
}
|
|
}
|
|
if (subMaterials.length === 1) {
|
|
if (subMaterials.length === 1) {
|
|
material = subMaterials[0];
|
|
material = subMaterials[0];
|
|
@@ -1075,7 +1076,7 @@ var importMesh = function (gltfRuntime, node, meshes, id, newMesh) {
|
|
newMesh.material = material;
|
|
newMesh.material = material;
|
|
}
|
|
}
|
|
// Apply geometry
|
|
// Apply geometry
|
|
- new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Geometry"](id, gltfRuntime.scene, vertexData, false, newMesh);
|
|
|
|
|
|
+ new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Geometry"](id, gltfRuntime.scene, vertexData, false, newMesh);
|
|
newMesh.computeWorldMatrix(true);
|
|
newMesh.computeWorldMatrix(true);
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
// Apply submeshes
|
|
// Apply submeshes
|
|
@@ -1091,7 +1092,7 @@ var importMesh = function (gltfRuntime, node, meshes, id, newMesh) {
|
|
if (mesh.primitives[i].mode !== 4) {
|
|
if (mesh.primitives[i].mode !== 4) {
|
|
//continue;
|
|
//continue;
|
|
}
|
|
}
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["SubMesh"].AddToMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["SubMesh"].AddToMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
|
|
index++;
|
|
index++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1117,15 +1118,15 @@ var configureNode = function (newNode, position, rotation, scaling) {
|
|
*/
|
|
*/
|
|
var configureNodeFromMatrix = function (newNode, node, parent) {
|
|
var configureNodeFromMatrix = function (newNode, node, parent) {
|
|
if (node.matrix) {
|
|
if (node.matrix) {
|
|
- var position = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 0, 0);
|
|
|
|
- var rotation = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Quaternion"]();
|
|
|
|
- var scaling = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 0, 0);
|
|
|
|
- var mat = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Matrix"].FromArray(node.matrix);
|
|
|
|
|
|
+ var position = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 0, 0);
|
|
|
|
+ var rotation = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Quaternion"]();
|
|
|
|
+ var scaling = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 0, 0);
|
|
|
|
+ var mat = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Matrix"].FromArray(node.matrix);
|
|
mat.decompose(scaling, rotation, position);
|
|
mat.decompose(scaling, rotation, position);
|
|
configureNode(newNode, position, rotation, scaling);
|
|
configureNode(newNode, position, rotation, scaling);
|
|
}
|
|
}
|
|
else if (node.translation && node.rotation && node.scale) {
|
|
else if (node.translation && node.rotation && node.scale) {
|
|
- configureNode(newNode, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(node.translation), babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromArray(node.rotation), babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(node.scale));
|
|
|
|
|
|
+ configureNode(newNode, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(node.translation), babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromArray(node.rotation), babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(node.scale));
|
|
}
|
|
}
|
|
newNode.computeWorldMatrix(true);
|
|
newNode.computeWorldMatrix(true);
|
|
};
|
|
};
|
|
@@ -1167,37 +1168,37 @@ var importNode = function (gltfRuntime, node, id, parent) {
|
|
if (light) {
|
|
if (light) {
|
|
if (light.type === "ambient") {
|
|
if (light.type === "ambient") {
|
|
var ambienLight = light[light.type];
|
|
var ambienLight = light[light.type];
|
|
- var hemiLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["HemisphericLight"](node.light, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene);
|
|
|
|
|
|
+ var hemiLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["HemisphericLight"](node.light, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene);
|
|
hemiLight.name = node.name || "";
|
|
hemiLight.name = node.name || "";
|
|
if (ambienLight.color) {
|
|
if (ambienLight.color) {
|
|
- hemiLight.diffuse = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(ambienLight.color);
|
|
|
|
|
|
+ hemiLight.diffuse = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(ambienLight.color);
|
|
}
|
|
}
|
|
lastNode = hemiLight;
|
|
lastNode = hemiLight;
|
|
}
|
|
}
|
|
else if (light.type === "directional") {
|
|
else if (light.type === "directional") {
|
|
var directionalLight = light[light.type];
|
|
var directionalLight = light[light.type];
|
|
- var dirLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["DirectionalLight"](node.light, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene);
|
|
|
|
|
|
+ var dirLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["DirectionalLight"](node.light, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene);
|
|
dirLight.name = node.name || "";
|
|
dirLight.name = node.name || "";
|
|
if (directionalLight.color) {
|
|
if (directionalLight.color) {
|
|
- dirLight.diffuse = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(directionalLight.color);
|
|
|
|
|
|
+ dirLight.diffuse = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(directionalLight.color);
|
|
}
|
|
}
|
|
lastNode = dirLight;
|
|
lastNode = dirLight;
|
|
}
|
|
}
|
|
else if (light.type === "point") {
|
|
else if (light.type === "point") {
|
|
var pointLight = light[light.type];
|
|
var pointLight = light[light.type];
|
|
- var ptLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["PointLight"](node.light, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene);
|
|
|
|
|
|
+ var ptLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["PointLight"](node.light, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene);
|
|
ptLight.name = node.name || "";
|
|
ptLight.name = node.name || "";
|
|
if (pointLight.color) {
|
|
if (pointLight.color) {
|
|
- ptLight.diffuse = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(pointLight.color);
|
|
|
|
|
|
+ ptLight.diffuse = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(pointLight.color);
|
|
}
|
|
}
|
|
lastNode = ptLight;
|
|
lastNode = ptLight;
|
|
}
|
|
}
|
|
else if (light.type === "spot") {
|
|
else if (light.type === "spot") {
|
|
var spotLight = light[light.type];
|
|
var spotLight = light[light.type];
|
|
- var spLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["SpotLight"](node.light, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), 0, 0, gltfRuntime.scene);
|
|
|
|
|
|
+ var spLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["SpotLight"](node.light, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), 0, 0, gltfRuntime.scene);
|
|
spLight.name = node.name || "";
|
|
spLight.name = node.name || "";
|
|
if (spotLight.color) {
|
|
if (spotLight.color) {
|
|
- spLight.diffuse = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(spotLight.color);
|
|
|
|
|
|
+ spLight.diffuse = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(spotLight.color);
|
|
}
|
|
}
|
|
if (spotLight.fallOfAngle) {
|
|
if (spotLight.fallOfAngle) {
|
|
spLight.angle = spotLight.fallOfAngle;
|
|
spLight.angle = spotLight.fallOfAngle;
|
|
@@ -1215,15 +1216,15 @@ var importNode = function (gltfRuntime, node, id, parent) {
|
|
if (camera) {
|
|
if (camera) {
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
if (camera.type === "orthographic") {
|
|
if (camera.type === "orthographic") {
|
|
- var orthoCamera = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["FreeCamera"](node.camera, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene, false);
|
|
|
|
|
|
+ var orthoCamera = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["FreeCamera"](node.camera, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene, false);
|
|
orthoCamera.name = node.name || "";
|
|
orthoCamera.name = node.name || "";
|
|
- orthoCamera.mode = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Camera"].ORTHOGRAPHIC_CAMERA;
|
|
|
|
|
|
+ orthoCamera.mode = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Camera"].ORTHOGRAPHIC_CAMERA;
|
|
orthoCamera.attachControl(gltfRuntime.scene.getEngine().getInputElement());
|
|
orthoCamera.attachControl(gltfRuntime.scene.getEngine().getInputElement());
|
|
lastNode = orthoCamera;
|
|
lastNode = orthoCamera;
|
|
}
|
|
}
|
|
else if (camera.type === "perspective") {
|
|
else if (camera.type === "perspective") {
|
|
var perspectiveCamera = camera[camera.type];
|
|
var perspectiveCamera = camera[camera.type];
|
|
- var persCamera = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["FreeCamera"](node.camera, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene, false);
|
|
|
|
|
|
+ var persCamera = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["FreeCamera"](node.camera, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(), gltfRuntime.scene, false);
|
|
persCamera.name = node.name || "";
|
|
persCamera.name = node.name || "";
|
|
persCamera.attachControl(gltfRuntime.scene.getEngine().getInputElement());
|
|
persCamera.attachControl(gltfRuntime.scene.getEngine().getInputElement());
|
|
if (!perspectiveCamera.aspectRatio) {
|
|
if (!perspectiveCamera.aspectRatio) {
|
|
@@ -1245,21 +1246,21 @@ var importNode = function (gltfRuntime, node, id, parent) {
|
|
}
|
|
}
|
|
else if (lastNode === null) {
|
|
else if (lastNode === null) {
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
- var dummy = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Mesh"](node.name || "", gltfRuntime.scene);
|
|
|
|
|
|
+ var dummy = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Mesh"](node.name || "", gltfRuntime.scene);
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
node.babylonNode = dummy;
|
|
node.babylonNode = dummy;
|
|
lastNode = dummy;
|
|
lastNode = dummy;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (lastNode !== null) {
|
|
if (lastNode !== null) {
|
|
- if (node.matrix && lastNode instanceof babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Mesh"]) {
|
|
|
|
|
|
+ if (node.matrix && lastNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Mesh"]) {
|
|
configureNodeFromMatrix(lastNode, node, parent);
|
|
configureNodeFromMatrix(lastNode, node, parent);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
var translation = node.translation || [0, 0, 0];
|
|
var translation = node.translation || [0, 0, 0];
|
|
var rotation = node.rotation || [0, 0, 0, 1];
|
|
var rotation = node.rotation || [0, 0, 0, 1];
|
|
var scale = node.scale || [1, 1, 1];
|
|
var scale = node.scale || [1, 1, 1];
|
|
- configureNode(lastNode, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(translation), babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromArray(rotation), babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(scale));
|
|
|
|
|
|
+ configureNode(lastNode, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(translation), babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromArray(rotation), babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(scale));
|
|
}
|
|
}
|
|
lastNode.updateCache(true);
|
|
lastNode.updateCache(true);
|
|
node.babylonNode = lastNode;
|
|
node.babylonNode = lastNode;
|
|
@@ -1560,11 +1561,11 @@ var GLTFLoaderBase = /** @class */ (function () {
|
|
};
|
|
};
|
|
GLTFLoaderBase.LoadBufferAsync = function (gltfRuntime, id, onSuccess, onError, onProgress) {
|
|
GLTFLoaderBase.LoadBufferAsync = function (gltfRuntime, id, onSuccess, onError, onProgress) {
|
|
var buffer = gltfRuntime.buffers[id];
|
|
var buffer = gltfRuntime.buffers[id];
|
|
- if (babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].IsBase64(buffer.uri)) {
|
|
|
|
- setTimeout(function () { return onSuccess(new Uint8Array(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].DecodeBase64(buffer.uri))); });
|
|
|
|
|
|
+ if (babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].IsBase64(buffer.uri)) {
|
|
|
|
+ setTimeout(function () { return onSuccess(new Uint8Array(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].DecodeBase64(buffer.uri))); });
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].LoadFile(gltfRuntime.rootUrl + buffer.uri, function (data) { return onSuccess(new Uint8Array(data)); }, onProgress, undefined, true, function (request) {
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].LoadFile(gltfRuntime.rootUrl + buffer.uri, function (data) { return onSuccess(new Uint8Array(data)); }, onProgress, undefined, true, function (request) {
|
|
if (request) {
|
|
if (request) {
|
|
onError(request.status + " " + request.statusText);
|
|
onError(request.status + " " + request.statusText);
|
|
}
|
|
}
|
|
@@ -1582,11 +1583,11 @@ var GLTFLoaderBase = /** @class */ (function () {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
var source = gltfRuntime.images[texture.source];
|
|
var source = gltfRuntime.images[texture.source];
|
|
- if (babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].IsBase64(source.uri)) {
|
|
|
|
- setTimeout(function () { return onSuccess(new Uint8Array(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].DecodeBase64(source.uri))); });
|
|
|
|
|
|
+ if (babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].IsBase64(source.uri)) {
|
|
|
|
+ setTimeout(function () { return onSuccess(new Uint8Array(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].DecodeBase64(source.uri))); });
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].LoadFile(gltfRuntime.rootUrl + source.uri, function (data) { return onSuccess(new Uint8Array(data)); }, undefined, undefined, true, function (request) {
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].LoadFile(gltfRuntime.rootUrl + source.uri, function (data) { return onSuccess(new Uint8Array(data)); }, undefined, undefined, true, function (request) {
|
|
if (request) {
|
|
if (request) {
|
|
onError(request.status + " " + request.statusText);
|
|
onError(request.status + " " + request.statusText);
|
|
}
|
|
}
|
|
@@ -1604,11 +1605,11 @@ var GLTFLoaderBase = /** @class */ (function () {
|
|
(sampler.minFilter === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].NEAREST_MIPMAP_LINEAR) ||
|
|
(sampler.minFilter === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].NEAREST_MIPMAP_LINEAR) ||
|
|
(sampler.minFilter === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR_MIPMAP_NEAREST) ||
|
|
(sampler.minFilter === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR_MIPMAP_NEAREST) ||
|
|
(sampler.minFilter === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR_MIPMAP_LINEAR);
|
|
(sampler.minFilter === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR_MIPMAP_LINEAR);
|
|
- var samplingMode = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"].BILINEAR_SAMPLINGMODE;
|
|
|
|
|
|
+ var samplingMode = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"].BILINEAR_SAMPLINGMODE;
|
|
var blob = buffer == null ? new Blob() : new Blob([buffer]);
|
|
var blob = buffer == null ? new Blob() : new Blob([buffer]);
|
|
var blobURL = URL.createObjectURL(blob);
|
|
var blobURL = URL.createObjectURL(blob);
|
|
var revokeBlobURL = function () { return URL.revokeObjectURL(blobURL); };
|
|
var revokeBlobURL = function () { return URL.revokeObjectURL(blobURL); };
|
|
- var newTexture = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"](blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL);
|
|
|
|
|
|
+ var newTexture = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"](blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL);
|
|
if (sampler.wrapS !== undefined) {
|
|
if (sampler.wrapS !== undefined) {
|
|
newTexture.wrapU = _glTFLoaderUtils__WEBPACK_IMPORTED_MODULE_2__["GLTFUtils"].GetWrapMode(sampler.wrapS);
|
|
newTexture.wrapU = _glTFLoaderUtils__WEBPACK_IMPORTED_MODULE_2__["GLTFUtils"].GetWrapMode(sampler.wrapS);
|
|
}
|
|
}
|
|
@@ -1621,14 +1622,14 @@ var GLTFLoaderBase = /** @class */ (function () {
|
|
};
|
|
};
|
|
GLTFLoaderBase.LoadShaderStringAsync = function (gltfRuntime, id, onSuccess, onError) {
|
|
GLTFLoaderBase.LoadShaderStringAsync = function (gltfRuntime, id, onSuccess, onError) {
|
|
var shader = gltfRuntime.shaders[id];
|
|
var shader = gltfRuntime.shaders[id];
|
|
- if (babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].IsBase64(shader.uri)) {
|
|
|
|
|
|
+ if (babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].IsBase64(shader.uri)) {
|
|
var shaderString = atob(shader.uri.split(",")[1]);
|
|
var shaderString = atob(shader.uri.split(",")[1]);
|
|
if (onSuccess) {
|
|
if (onSuccess) {
|
|
onSuccess(shaderString);
|
|
onSuccess(shaderString);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, undefined, undefined, false, function (request) {
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, undefined, undefined, false, function (request) {
|
|
if (request && onError) {
|
|
if (request && onError) {
|
|
onError(request.status + " " + request.statusText);
|
|
onError(request.status + " " + request.statusText);
|
|
}
|
|
}
|
|
@@ -1646,17 +1647,17 @@ var GLTFLoaderBase = /** @class */ (function () {
|
|
var technique = gltfRuntime.techniques[material.technique];
|
|
var technique = gltfRuntime.techniques[material.technique];
|
|
if (!technique) {
|
|
if (!technique) {
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
gltfRuntime.scene._blockEntityCollection = gltfRuntime.forAssetContainer;
|
|
- var defaultMaterial = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"](id, gltfRuntime.scene);
|
|
|
|
|
|
+ var defaultMaterial = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"](id, gltfRuntime.scene);
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
gltfRuntime.scene._blockEntityCollection = false;
|
|
- defaultMaterial.diffuseColor = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.5, 0.5, 0.5);
|
|
|
|
- defaultMaterial.sideOrientation = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Material"].CounterClockWiseSideOrientation;
|
|
|
|
|
|
+ defaultMaterial.diffuseColor = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.5, 0.5, 0.5);
|
|
|
|
+ defaultMaterial.sideOrientation = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Material"].CounterClockWiseSideOrientation;
|
|
onSuccess(defaultMaterial);
|
|
onSuccess(defaultMaterial);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
var program = gltfRuntime.programs[technique.program];
|
|
var program = gltfRuntime.programs[technique.program];
|
|
var states = technique.states;
|
|
var states = technique.states;
|
|
- var vertexShader = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[program.vertexShader + "VertexShader"];
|
|
|
|
- var pixelShader = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[program.fragmentShader + "PixelShader"];
|
|
|
|
|
|
+ var vertexShader = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[program.vertexShader + "VertexShader"];
|
|
|
|
+ var pixelShader = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[program.fragmentShader + "PixelShader"];
|
|
var newVertexShader = "";
|
|
var newVertexShader = "";
|
|
var newPixelShader = "";
|
|
var newPixelShader = "";
|
|
var vertexTokenizer = new Tokenizer(vertexShader);
|
|
var vertexTokenizer = new Tokenizer(vertexShader);
|
|
@@ -1739,12 +1740,12 @@ var GLTFLoaderBase = /** @class */ (function () {
|
|
samplers: samplers,
|
|
samplers: samplers,
|
|
needAlphaBlending: states && states.enable && states.enable.indexOf(3042) !== -1
|
|
needAlphaBlending: states && states.enable && states.enable.indexOf(3042) !== -1
|
|
};
|
|
};
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader;
|
|
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader;
|
|
|
|
- var shaderMaterial = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["ShaderMaterial"](id, gltfRuntime.scene, shaderPath, options);
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader;
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader;
|
|
|
|
+ var shaderMaterial = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["ShaderMaterial"](id, gltfRuntime.scene, shaderPath, options);
|
|
shaderMaterial.onError = onShaderCompileError(program, shaderMaterial, onError);
|
|
shaderMaterial.onError = onShaderCompileError(program, shaderMaterial, onError);
|
|
shaderMaterial.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess);
|
|
shaderMaterial.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess);
|
|
- shaderMaterial.sideOrientation = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Material"].CounterClockWiseSideOrientation;
|
|
|
|
|
|
+ shaderMaterial.sideOrientation = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Material"].CounterClockWiseSideOrientation;
|
|
if (states && states.functions) {
|
|
if (states && states.functions) {
|
|
var functions = states.functions;
|
|
var functions = states.functions;
|
|
if (functions.cullFace && functions.cullFace[0] !== _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ECullingType"].BACK) {
|
|
if (functions.cullFace && functions.cullFace[0] !== _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ECullingType"].BACK) {
|
|
@@ -1753,22 +1754,22 @@ var GLTFLoaderBase = /** @class */ (function () {
|
|
var blendFunc = functions.blendFuncSeparate;
|
|
var blendFunc = functions.blendFuncSeparate;
|
|
if (blendFunc) {
|
|
if (blendFunc) {
|
|
if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].SRC_ALPHA && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE_MINUS_SRC_ALPHA && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].SRC_ALPHA && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE_MINUS_SRC_ALPHA && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
- shaderMaterial.alphaMode = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_COMBINE;
|
|
|
|
|
|
+ shaderMaterial.alphaMode = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_COMBINE;
|
|
}
|
|
}
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ZERO && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ZERO && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
- shaderMaterial.alphaMode = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_ONEONE;
|
|
|
|
|
|
+ shaderMaterial.alphaMode = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_ONEONE;
|
|
}
|
|
}
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].SRC_ALPHA && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ZERO && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].SRC_ALPHA && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ZERO && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
- shaderMaterial.alphaMode = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_ADD;
|
|
|
|
|
|
+ shaderMaterial.alphaMode = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_ADD;
|
|
}
|
|
}
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ZERO && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE_MINUS_SRC_COLOR && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ZERO && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE_MINUS_SRC_COLOR && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
- shaderMaterial.alphaMode = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_SUBTRACT;
|
|
|
|
|
|
+ shaderMaterial.alphaMode = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_SUBTRACT;
|
|
}
|
|
}
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].DST_COLOR && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ZERO && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].DST_COLOR && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ZERO && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
- shaderMaterial.alphaMode = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_MULTIPLY;
|
|
|
|
|
|
+ shaderMaterial.alphaMode = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_MULTIPLY;
|
|
}
|
|
}
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].SRC_ALPHA && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE_MINUS_SRC_COLOR && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
else if (blendFunc[0] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].SRC_ALPHA && blendFunc[1] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE_MINUS_SRC_COLOR && blendFunc[2] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE && blendFunc[3] === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EBlendingFunction"].ONE) {
|
|
- shaderMaterial.alphaMode = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_MAXIMIZED;
|
|
|
|
|
|
+ shaderMaterial.alphaMode = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_MAXIMIZED;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1786,7 +1787,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
}
|
|
}
|
|
GLTFLoader.RegisterExtension = function (extension) {
|
|
GLTFLoader.RegisterExtension = function (extension) {
|
|
if (GLTFLoader.Extensions[extension.name]) {
|
|
if (GLTFLoader.Extensions[extension.name]) {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("Tool with the same name \"" + extension.name + "\" already exists");
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("Tool with the same name \"" + extension.name + "\" already exists");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
GLTFLoader.Extensions[extension.name] = extension;
|
|
GLTFLoader.Extensions[extension.name] = extension;
|
|
@@ -1811,7 +1812,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
gltfRuntime.importMeshesNames = [];
|
|
gltfRuntime.importMeshesNames = [];
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Argument meshesNames must be of type string or string[]");
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Argument meshesNames must be of type string or string[]");
|
|
}
|
|
}
|
|
// Create nodes
|
|
// Create nodes
|
|
_this._createNodes(gltfRuntime);
|
|
_this._createNodes(gltfRuntime);
|
|
@@ -1820,13 +1821,13 @@ var GLTFLoader = /** @class */ (function () {
|
|
// Fill arrays of meshes and skeletons
|
|
// Fill arrays of meshes and skeletons
|
|
for (var nde in gltfRuntime.nodes) {
|
|
for (var nde in gltfRuntime.nodes) {
|
|
var node = gltfRuntime.nodes[nde];
|
|
var node = gltfRuntime.nodes[nde];
|
|
- if (node.babylonNode instanceof babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["AbstractMesh"]) {
|
|
|
|
|
|
+ if (node.babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["AbstractMesh"]) {
|
|
meshes.push(node.babylonNode);
|
|
meshes.push(node.babylonNode);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (var skl in gltfRuntime.skins) {
|
|
for (var skl in gltfRuntime.skins) {
|
|
var skin = gltfRuntime.skins[skl];
|
|
var skin = gltfRuntime.skins[skl];
|
|
- if (skin.babylonSkeleton instanceof babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Skeleton"]) {
|
|
|
|
|
|
+ if (skin.babylonSkeleton instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Skeleton"]) {
|
|
skeletons.push(skin.babylonSkeleton);
|
|
skeletons.push(skin.babylonSkeleton);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1924,13 +1925,13 @@ var GLTFLoader = /** @class */ (function () {
|
|
}
|
|
}
|
|
gltfRuntime.loadedShaderCount++;
|
|
gltfRuntime.loadedShaderCount++;
|
|
if (shaderString) {
|
|
if (shaderString) {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[sha + (shader.type === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EShaderType"].VERTEX ? "VertexShader" : "PixelShader")] = shaderString;
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[sha + (shader.type === _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EShaderType"].VERTEX ? "VertexShader" : "PixelShader")] = shaderString;
|
|
}
|
|
}
|
|
if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) {
|
|
if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) {
|
|
onload();
|
|
onload();
|
|
}
|
|
}
|
|
}, function () {
|
|
}, function () {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("Error when loading shader program named " + sha + " located at " + shader.uri);
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("Error when loading shader program named " + sha + " located at " + shader.uri);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
for (var sha in gltfRuntime.shaders) {
|
|
for (var sha in gltfRuntime.shaders) {
|
|
@@ -1940,7 +1941,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
processShader.bind(this, sha, shader)();
|
|
processShader.bind(this, sha, shader)();
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("No shader named: " + sha);
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("No shader named: " + sha);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!hasShaders) {
|
|
if (!hasShaders) {
|
|
@@ -1954,7 +1955,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
gltfRuntime.loadedBufferCount++;
|
|
gltfRuntime.loadedBufferCount++;
|
|
if (bufferView) {
|
|
if (bufferView) {
|
|
if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) {
|
|
if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength); // Improve error message
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength); // Improve error message
|
|
}
|
|
}
|
|
gltfRuntime.loadedBufferViews[buf] = bufferView;
|
|
gltfRuntime.loadedBufferViews[buf] = bufferView;
|
|
}
|
|
}
|
|
@@ -1962,7 +1963,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
onLoad();
|
|
onLoad();
|
|
}
|
|
}
|
|
}, function () {
|
|
}, function () {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("Error when loading buffer named " + buf + " located at " + buffer.uri);
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("Error when loading buffer named " + buf + " located at " + buffer.uri);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
for (var buf in gltfRuntime.buffers) {
|
|
for (var buf in gltfRuntime.buffers) {
|
|
@@ -1972,7 +1973,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
processBuffer.bind(this, buf, buffer)();
|
|
processBuffer.bind(this, buf, buffer)();
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("No buffer named: " + buf);
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Error("No buffer named: " + buf);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!hasBuffers) {
|
|
if (!hasBuffers) {
|
|
@@ -2272,8 +2273,9 @@ var EBlendingFunction;
|
|
__webpack_require__.r(__webpack_exports__);
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLTFUtils", function() { return GLTFUtils; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLTFUtils", function() { return GLTFUtils; });
|
|
/* harmony import */ var _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./glTFLoaderInterfaces */ "./glTF/1.0/glTFLoaderInterfaces.ts");
|
|
/* harmony import */ var _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./glTFLoaderInterfaces */ "./glTF/1.0/glTFLoaderInterfaces.ts");
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
|
|
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math.vector */ "babylonjs/Misc/tools");
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2306,7 +2308,7 @@ var GLTFUtils = /** @class */ (function () {
|
|
mat = scene.getViewMatrix();
|
|
mat = scene.getViewMatrix();
|
|
}
|
|
}
|
|
else if (parameter.semantic === "MODELVIEWINVERSETRANSPOSE") {
|
|
else if (parameter.semantic === "MODELVIEWINVERSETRANSPOSE") {
|
|
- mat = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert());
|
|
|
|
|
|
+ mat = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert());
|
|
}
|
|
}
|
|
else if (parameter.semantic === "MODELVIEW") {
|
|
else if (parameter.semantic === "MODELVIEW") {
|
|
mat = source.getWorldMatrix().multiply(scene.getViewMatrix());
|
|
mat = source.getWorldMatrix().multiply(scene.getViewMatrix());
|
|
@@ -2330,7 +2332,7 @@ var GLTFUtils = /** @class */ (function () {
|
|
mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert();
|
|
mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert();
|
|
}
|
|
}
|
|
else if (parameter.semantic === "MODELINVERSETRANSPOSE") {
|
|
else if (parameter.semantic === "MODELINVERSETRANSPOSE") {
|
|
- mat = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Transpose(source.getWorldMatrix().invert());
|
|
|
|
|
|
+ mat = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Transpose(source.getWorldMatrix().invert());
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
debugger;
|
|
debugger;
|
|
@@ -2338,10 +2340,10 @@ var GLTFUtils = /** @class */ (function () {
|
|
if (mat) {
|
|
if (mat) {
|
|
switch (parameter.type) {
|
|
switch (parameter.type) {
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_MAT2:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_MAT2:
|
|
- shaderMaterial.setMatrix2x2(uniformName, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Matrix"].GetAsMatrix2x2(mat));
|
|
|
|
|
|
+ shaderMaterial.setMatrix2x2(uniformName, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Matrix"].GetAsMatrix2x2(mat));
|
|
break;
|
|
break;
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_MAT3:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_MAT3:
|
|
- shaderMaterial.setMatrix3x3(uniformName, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Matrix"].GetAsMatrix3x3(mat));
|
|
|
|
|
|
+ shaderMaterial.setMatrix3x3(uniformName, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Matrix"].GetAsMatrix3x3(mat));
|
|
break;
|
|
break;
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_MAT4:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_MAT4:
|
|
shaderMaterial.setMatrix(uniformName, mat);
|
|
shaderMaterial.setMatrix(uniformName, mat);
|
|
@@ -2363,13 +2365,13 @@ var GLTFUtils = /** @class */ (function () {
|
|
shaderMaterial.setFloat(uniform, value);
|
|
shaderMaterial.setFloat(uniform, value);
|
|
return true;
|
|
return true;
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_VEC2:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_VEC2:
|
|
- shaderMaterial.setVector2(uniform, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector2"].FromArray(value));
|
|
|
|
|
|
+ shaderMaterial.setVector2(uniform, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector2"].FromArray(value));
|
|
return true;
|
|
return true;
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_VEC3:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_VEC3:
|
|
- shaderMaterial.setVector3(uniform, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(value));
|
|
|
|
|
|
+ shaderMaterial.setVector3(uniform, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(value));
|
|
return true;
|
|
return true;
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_VEC4:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["EParameterType"].FLOAT_VEC4:
|
|
- shaderMaterial.setVector4(uniform, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Vector4"].FromArray(value));
|
|
|
|
|
|
+ shaderMaterial.setVector4(uniform, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector4"].FromArray(value));
|
|
return true;
|
|
return true;
|
|
default: return false;
|
|
default: return false;
|
|
}
|
|
}
|
|
@@ -2380,10 +2382,10 @@ var GLTFUtils = /** @class */ (function () {
|
|
*/
|
|
*/
|
|
GLTFUtils.GetWrapMode = function (mode) {
|
|
GLTFUtils.GetWrapMode = function (mode) {
|
|
switch (mode) {
|
|
switch (mode) {
|
|
- case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureWrapMode"].CLAMP_TO_EDGE: return babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"].CLAMP_ADDRESSMODE;
|
|
|
|
- case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureWrapMode"].MIRRORED_REPEAT: return babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"].MIRROR_ADDRESSMODE;
|
|
|
|
- case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureWrapMode"].REPEAT: return babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"].WRAP_ADDRESSMODE;
|
|
|
|
- default: return babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"].WRAP_ADDRESSMODE;
|
|
|
|
|
|
+ case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureWrapMode"].CLAMP_TO_EDGE: return babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"].CLAMP_ADDRESSMODE;
|
|
|
|
+ case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureWrapMode"].MIRRORED_REPEAT: return babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"].MIRROR_ADDRESSMODE;
|
|
|
|
+ case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureWrapMode"].REPEAT: return babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"].WRAP_ADDRESSMODE;
|
|
|
|
+ default: return babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"].WRAP_ADDRESSMODE;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -2411,10 +2413,10 @@ var GLTFUtils = /** @class */ (function () {
|
|
switch (mode) {
|
|
switch (mode) {
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR_MIPMAP_NEAREST:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR_MIPMAP_NEAREST:
|
|
- case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR_MIPMAP_LINEAR: return babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"].TRILINEAR_SAMPLINGMODE;
|
|
|
|
|
|
+ case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].LINEAR_MIPMAP_LINEAR: return babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"].TRILINEAR_SAMPLINGMODE;
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].NEAREST:
|
|
case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].NEAREST:
|
|
- case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].NEAREST_MIPMAP_NEAREST: return babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"].NEAREST_SAMPLINGMODE;
|
|
|
|
- default: return babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Texture"].BILINEAR_SAMPLINGMODE;
|
|
|
|
|
|
+ case _glTFLoaderInterfaces__WEBPACK_IMPORTED_MODULE_0__["ETextureFilterType"].NEAREST_MIPMAP_NEAREST: return babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"].NEAREST_SAMPLINGMODE;
|
|
|
|
+ default: return babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Texture"].BILINEAR_SAMPLINGMODE;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
GLTFUtils.GetBufferFromBufferView = function (gltfRuntime, bufferView, byteOffset, byteLength, componentType) {
|
|
GLTFUtils.GetBufferFromBufferView = function (gltfRuntime, bufferView, byteOffset, byteLength, componentType) {
|
|
@@ -2462,7 +2464,7 @@ var GLTFUtils = /** @class */ (function () {
|
|
*/
|
|
*/
|
|
GLTFUtils.GetDefaultMaterial = function (scene) {
|
|
GLTFUtils.GetDefaultMaterial = function (scene) {
|
|
if (!GLTFUtils._DefaultMaterial) {
|
|
if (!GLTFUtils._DefaultMaterial) {
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["GLTFDefaultMaterialVertexShader"] = [
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["GLTFDefaultMaterialVertexShader"] = [
|
|
"precision highp float;",
|
|
"precision highp float;",
|
|
"",
|
|
"",
|
|
"uniform mat4 worldView;",
|
|
"uniform mat4 worldView;",
|
|
@@ -2475,7 +2477,7 @@ var GLTFUtils = /** @class */ (function () {
|
|
" gl_Position = projection * worldView * vec4(position, 1.0);",
|
|
" gl_Position = projection * worldView * vec4(position, 1.0);",
|
|
"}"
|
|
"}"
|
|
].join("\n");
|
|
].join("\n");
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["GLTFDefaultMaterialPixelShader"] = [
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["GLTFDefaultMaterialPixelShader"] = [
|
|
"precision highp float;",
|
|
"precision highp float;",
|
|
"",
|
|
"",
|
|
"uniform vec4 u_emission;",
|
|
"uniform vec4 u_emission;",
|
|
@@ -2495,8 +2497,8 @@ var GLTFUtils = /** @class */ (function () {
|
|
samplers: new Array(),
|
|
samplers: new Array(),
|
|
needAlphaBlending: false
|
|
needAlphaBlending: false
|
|
};
|
|
};
|
|
- GLTFUtils._DefaultMaterial = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["ShaderMaterial"]("GLTFDefaultMaterial", scene, shaderPath, options);
|
|
|
|
- GLTFUtils._DefaultMaterial.setColor4("u_emission", new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__["Color4"](0.5, 0.5, 0.5, 1.0));
|
|
|
|
|
|
+ GLTFUtils._DefaultMaterial = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["ShaderMaterial"]("GLTFDefaultMaterial", scene, shaderPath, options);
|
|
|
|
+ GLTFUtils._DefaultMaterial.setColor4("u_emission", new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color4"](0.5, 0.5, 0.5, 1.0));
|
|
}
|
|
}
|
|
return GLTFUtils._DefaultMaterial;
|
|
return GLTFUtils._DefaultMaterial;
|
|
};
|
|
};
|
|
@@ -2521,8 +2523,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLTFMaterialsCommonExtension", function() { return GLTFMaterialsCommonExtension; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLTFMaterialsCommonExtension", function() { return GLTFMaterialsCommonExtension; });
|
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./glTFLoader */ "./glTF/1.0/glTFLoader.ts");
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./glTFLoader */ "./glTF/1.0/glTFLoader.ts");
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
|
|
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babylonjs/Maths/math.vector */ "babylonjs/Misc/tools");
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2556,35 +2559,35 @@ var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
|
|
var light = lights[thing];
|
|
var light = lights[thing];
|
|
switch (light.type) {
|
|
switch (light.type) {
|
|
case "ambient":
|
|
case "ambient":
|
|
- var ambientLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["HemisphericLight"](light.name, new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, 1, 0), gltfRuntime.scene);
|
|
|
|
|
|
+ var ambientLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["HemisphericLight"](light.name, new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, 1, 0), gltfRuntime.scene);
|
|
var ambient = light.ambient;
|
|
var ambient = light.ambient;
|
|
if (ambient) {
|
|
if (ambient) {
|
|
- ambientLight.diffuse = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(ambient.color || [1, 1, 1]);
|
|
|
|
|
|
+ ambientLight.diffuse = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(ambient.color || [1, 1, 1]);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "point":
|
|
case "point":
|
|
- var pointLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["PointLight"](light.name, new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Vector3"](10, 10, 10), gltfRuntime.scene);
|
|
|
|
|
|
+ var pointLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["PointLight"](light.name, new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Vector3"](10, 10, 10), gltfRuntime.scene);
|
|
var point = light.point;
|
|
var point = light.point;
|
|
if (point) {
|
|
if (point) {
|
|
- pointLight.diffuse = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(point.color || [1, 1, 1]);
|
|
|
|
|
|
+ pointLight.diffuse = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(point.color || [1, 1, 1]);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "directional":
|
|
case "directional":
|
|
- var dirLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["DirectionalLight"](light.name, new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, -1, 0), gltfRuntime.scene);
|
|
|
|
|
|
+ var dirLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["DirectionalLight"](light.name, new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, -1, 0), gltfRuntime.scene);
|
|
var directional = light.directional;
|
|
var directional = light.directional;
|
|
if (directional) {
|
|
if (directional) {
|
|
- dirLight.diffuse = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(directional.color || [1, 1, 1]);
|
|
|
|
|
|
+ dirLight.diffuse = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(directional.color || [1, 1, 1]);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "spot":
|
|
case "spot":
|
|
var spot = light.spot;
|
|
var spot = light.spot;
|
|
if (spot) {
|
|
if (spot) {
|
|
- var spotLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["SpotLight"](light.name, new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, 10, 0), new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, -1, 0), spot.fallOffAngle || Math.PI, spot.fallOffExponent || 0.0, gltfRuntime.scene);
|
|
|
|
- spotLight.diffuse = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(spot.color || [1, 1, 1]);
|
|
|
|
|
|
+ var spotLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["SpotLight"](light.name, new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, 10, 0), new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, -1, 0), spot.fallOffAngle || Math.PI, spot.fallOffExponent || 0.0, gltfRuntime.scene);
|
|
|
|
+ spotLight.diffuse = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(spot.color || [1, 1, 1]);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Tools"].Warn("GLTF Material Common extension: light type \"" + light.type + "\” not supported");
|
|
|
|
|
|
+ babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Tools"].Warn("GLTF Material Common extension: light type \"" + light.type + "\” not supported");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2600,8 +2603,8 @@ var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
|
|
if (!extension) {
|
|
if (!extension) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- var standardMaterial = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["StandardMaterial"](id, gltfRuntime.scene);
|
|
|
|
- standardMaterial.sideOrientation = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Material"].CounterClockWiseSideOrientation;
|
|
|
|
|
|
+ var standardMaterial = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["StandardMaterial"](id, gltfRuntime.scene);
|
|
|
|
+ standardMaterial.sideOrientation = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Material"].CounterClockWiseSideOrientation;
|
|
if (extension.technique === "CONSTANT") {
|
|
if (extension.technique === "CONSTANT") {
|
|
standardMaterial.disableLighting = true;
|
|
standardMaterial.disableLighting = true;
|
|
}
|
|
}
|
|
@@ -2613,28 +2616,28 @@ var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
|
|
this._loadTexture(gltfRuntime, extension.values.ambient, standardMaterial, "ambientTexture", onError);
|
|
this._loadTexture(gltfRuntime, extension.values.ambient, standardMaterial, "ambientTexture", onError);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- standardMaterial.ambientColor = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(extension.values.ambient || [0, 0, 0]);
|
|
|
|
|
|
+ standardMaterial.ambientColor = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(extension.values.ambient || [0, 0, 0]);
|
|
}
|
|
}
|
|
// Diffuse
|
|
// Diffuse
|
|
if (typeof extension.values.diffuse === "string") {
|
|
if (typeof extension.values.diffuse === "string") {
|
|
this._loadTexture(gltfRuntime, extension.values.diffuse, standardMaterial, "diffuseTexture", onError);
|
|
this._loadTexture(gltfRuntime, extension.values.diffuse, standardMaterial, "diffuseTexture", onError);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- standardMaterial.diffuseColor = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(extension.values.diffuse || [0, 0, 0]);
|
|
|
|
|
|
+ standardMaterial.diffuseColor = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(extension.values.diffuse || [0, 0, 0]);
|
|
}
|
|
}
|
|
// Emission
|
|
// Emission
|
|
if (typeof extension.values.emission === "string") {
|
|
if (typeof extension.values.emission === "string") {
|
|
this._loadTexture(gltfRuntime, extension.values.emission, standardMaterial, "emissiveTexture", onError);
|
|
this._loadTexture(gltfRuntime, extension.values.emission, standardMaterial, "emissiveTexture", onError);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- standardMaterial.emissiveColor = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(extension.values.emission || [0, 0, 0]);
|
|
|
|
|
|
+ standardMaterial.emissiveColor = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(extension.values.emission || [0, 0, 0]);
|
|
}
|
|
}
|
|
// Specular
|
|
// Specular
|
|
if (typeof extension.values.specular === "string") {
|
|
if (typeof extension.values.specular === "string") {
|
|
this._loadTexture(gltfRuntime, extension.values.specular, standardMaterial, "specularTexture", onError);
|
|
this._loadTexture(gltfRuntime, extension.values.specular, standardMaterial, "specularTexture", onError);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- standardMaterial.specularColor = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(extension.values.specular || [0, 0, 0]);
|
|
|
|
|
|
+ standardMaterial.specularColor = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Color3"].FromArray(extension.values.specular || [0, 0, 0]);
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
};
|
|
};
|
|
@@ -3001,8 +3004,8 @@ _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoader"].RegisterExtension(NAME, f
|
|
"use strict";
|
|
"use strict";
|
|
__webpack_require__.r(__webpack_exports__);
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KHR_lights", function() { return KHR_lights; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KHR_lights", function() { return KHR_lights; });
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
|
|
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math.vector */ "babylonjs/Misc/tools");
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glTFLoader */ "./glTF/2.0/glTFLoader.ts");
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glTFLoader */ "./glTF/2.0/glTFLoader.ts");
|
|
|
|
|
|
|
|
|
|
@@ -3010,6 +3013,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
var NAME = "KHR_lights_punctual";
|
|
var NAME = "KHR_lights_punctual";
|
|
var LightType;
|
|
var LightType;
|
|
(function (LightType) {
|
|
(function (LightType) {
|
|
@@ -3054,15 +3058,15 @@ var KHR_lights = /** @class */ (function () {
|
|
_this._loader.babylonScene._blockEntityCollection = _this._loader._forAssetContainer;
|
|
_this._loader.babylonScene._blockEntityCollection = _this._loader._forAssetContainer;
|
|
switch (light.type) {
|
|
switch (light.type) {
|
|
case LightType.DIRECTIONAL: {
|
|
case LightType.DIRECTIONAL: {
|
|
- babylonLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["DirectionalLight"](name, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Backward(), _this._loader.babylonScene);
|
|
|
|
|
|
+ babylonLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["DirectionalLight"](name, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Backward(), _this._loader.babylonScene);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case LightType.POINT: {
|
|
case LightType.POINT: {
|
|
- babylonLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["PointLight"](name, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), _this._loader.babylonScene);
|
|
|
|
|
|
+ babylonLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["PointLight"](name, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), _this._loader.babylonScene);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case LightType.SPOT: {
|
|
case LightType.SPOT: {
|
|
- var babylonSpotLight = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["SpotLight"](name, babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Backward(), 0, 1, _this._loader.babylonScene);
|
|
|
|
|
|
+ var babylonSpotLight = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["SpotLight"](name, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Backward(), 0, 1, _this._loader.babylonScene);
|
|
babylonSpotLight.angle = ((light.spot && light.spot.outerConeAngle) || Math.PI / 4) * 2;
|
|
babylonSpotLight.angle = ((light.spot && light.spot.outerConeAngle) || Math.PI / 4) * 2;
|
|
babylonSpotLight.innerAngle = ((light.spot && light.spot.innerConeAngle) || 0) * 2;
|
|
babylonSpotLight.innerAngle = ((light.spot && light.spot.innerConeAngle) || 0) * 2;
|
|
babylonLight = babylonSpotLight;
|
|
babylonLight = babylonSpotLight;
|
|
@@ -3074,8 +3078,8 @@ var KHR_lights = /** @class */ (function () {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
_this._loader.babylonScene._blockEntityCollection = false;
|
|
_this._loader.babylonScene._blockEntityCollection = false;
|
|
- babylonLight.falloffType = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Light"].FALLOFF_GLTF;
|
|
|
|
- babylonLight.diffuse = light.color ? babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(light.color) : babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color3"].White();
|
|
|
|
|
|
+ babylonLight.falloffType = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Light"].FALLOFF_GLTF;
|
|
|
|
+ babylonLight.diffuse = light.color ? babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(light.color) : babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Color3"].White();
|
|
babylonLight.intensity = light.intensity == undefined ? 1 : light.intensity;
|
|
babylonLight.intensity = light.intensity == undefined ? 1 : light.intensity;
|
|
babylonLight.range = light.range == undefined ? Number.MAX_VALUE : light.range;
|
|
babylonLight.range = light.range == undefined ? Number.MAX_VALUE : light.range;
|
|
babylonLight.parent = babylonMesh;
|
|
babylonLight.parent = babylonMesh;
|
|
@@ -3203,8 +3207,8 @@ _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoader"].RegisterExtension(NAME, f
|
|
"use strict";
|
|
"use strict";
|
|
__webpack_require__.r(__webpack_exports__);
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KHR_materials_pbrSpecularGlossiness", function() { return KHR_materials_pbrSpecularGlossiness; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KHR_materials_pbrSpecularGlossiness", function() { return KHR_materials_pbrSpecularGlossiness; });
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
|
|
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math.color */ "babylonjs/Misc/tools");
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glTFLoader */ "./glTF/2.0/glTFLoader.ts");
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glTFLoader */ "./glTF/2.0/glTFLoader.ts");
|
|
|
|
|
|
|
|
|
|
@@ -3243,20 +3247,20 @@ var KHR_materials_pbrSpecularGlossiness = /** @class */ (function () {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
KHR_materials_pbrSpecularGlossiness.prototype._loadSpecularGlossinessPropertiesAsync = function (context, material, properties, babylonMaterial) {
|
|
KHR_materials_pbrSpecularGlossiness.prototype._loadSpecularGlossinessPropertiesAsync = function (context, material, properties, babylonMaterial) {
|
|
- if (!(babylonMaterial instanceof babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"])) {
|
|
|
|
|
|
+ if (!(babylonMaterial instanceof babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"])) {
|
|
throw new Error(context + ": Material type not supported");
|
|
throw new Error(context + ": Material type not supported");
|
|
}
|
|
}
|
|
var promises = new Array();
|
|
var promises = new Array();
|
|
babylonMaterial.metallic = null;
|
|
babylonMaterial.metallic = null;
|
|
babylonMaterial.roughness = null;
|
|
babylonMaterial.roughness = null;
|
|
if (properties.diffuseFactor) {
|
|
if (properties.diffuseFactor) {
|
|
- babylonMaterial.albedoColor = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(properties.diffuseFactor);
|
|
|
|
|
|
+ babylonMaterial.albedoColor = babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(properties.diffuseFactor);
|
|
babylonMaterial.alpha = properties.diffuseFactor[3];
|
|
babylonMaterial.alpha = properties.diffuseFactor[3];
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- babylonMaterial.albedoColor = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color3"].White();
|
|
|
|
|
|
+ babylonMaterial.albedoColor = babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__["Color3"].White();
|
|
}
|
|
}
|
|
- babylonMaterial.reflectivityColor = properties.specularFactor ? babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(properties.specularFactor) : babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color3"].White();
|
|
|
|
|
|
+ babylonMaterial.reflectivityColor = properties.specularFactor ? babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(properties.specularFactor) : babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__["Color3"].White();
|
|
babylonMaterial.microSurface = properties.glossinessFactor == undefined ? 1 : properties.glossinessFactor;
|
|
babylonMaterial.microSurface = properties.glossinessFactor == undefined ? 1 : properties.glossinessFactor;
|
|
if (properties.diffuseTexture) {
|
|
if (properties.diffuseTexture) {
|
|
promises.push(this._loader.loadTextureInfoAsync(context + "/diffuseTexture", properties.diffuseTexture, function (texture) {
|
|
promises.push(this._loader.loadTextureInfoAsync(context + "/diffuseTexture", properties.diffuseTexture, function (texture) {
|
|
@@ -3443,8 +3447,8 @@ _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoader"].RegisterExtension(NAME, f
|
|
"use strict";
|
|
"use strict";
|
|
__webpack_require__.r(__webpack_exports__);
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KHR_materials_unlit", function() { return KHR_materials_unlit; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KHR_materials_unlit", function() { return KHR_materials_unlit; });
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
|
|
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math.color */ "babylonjs/Misc/tools");
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glTFLoader */ "./glTF/2.0/glTFLoader.ts");
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glTFLoader */ "./glTF/2.0/glTFLoader.ts");
|
|
|
|
|
|
|
|
|
|
@@ -3479,7 +3483,7 @@ var KHR_materials_unlit = /** @class */ (function () {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
KHR_materials_unlit.prototype._loadUnlitPropertiesAsync = function (context, material, babylonMaterial) {
|
|
KHR_materials_unlit.prototype._loadUnlitPropertiesAsync = function (context, material, babylonMaterial) {
|
|
- if (!(babylonMaterial instanceof babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"])) {
|
|
|
|
|
|
+ if (!(babylonMaterial instanceof babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"])) {
|
|
throw new Error(context + ": Material type not supported");
|
|
throw new Error(context + ": Material type not supported");
|
|
}
|
|
}
|
|
var promises = new Array();
|
|
var promises = new Array();
|
|
@@ -3487,11 +3491,11 @@ var KHR_materials_unlit = /** @class */ (function () {
|
|
var properties = material.pbrMetallicRoughness;
|
|
var properties = material.pbrMetallicRoughness;
|
|
if (properties) {
|
|
if (properties) {
|
|
if (properties.baseColorFactor) {
|
|
if (properties.baseColorFactor) {
|
|
- babylonMaterial.albedoColor = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(properties.baseColorFactor);
|
|
|
|
|
|
+ babylonMaterial.albedoColor = babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(properties.baseColorFactor);
|
|
babylonMaterial.alpha = properties.baseColorFactor[3];
|
|
babylonMaterial.alpha = properties.baseColorFactor[3];
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- babylonMaterial.albedoColor = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color3"].White();
|
|
|
|
|
|
+ babylonMaterial.albedoColor = babylonjs_Maths_math_color__WEBPACK_IMPORTED_MODULE_0__["Color3"].White();
|
|
}
|
|
}
|
|
if (properties.baseColorTexture) {
|
|
if (properties.baseColorTexture) {
|
|
promises.push(this._loader.loadTextureInfoAsync(context + "/baseColorTexture", properties.baseColorTexture, function (texture) {
|
|
promises.push(this._loader.loadTextureInfoAsync(context + "/baseColorTexture", properties.baseColorTexture, function (texture) {
|
|
@@ -3681,8 +3685,8 @@ _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoader"].RegisterExtension(NAME, f
|
|
"use strict";
|
|
"use strict";
|
|
__webpack_require__.r(__webpack_exports__);
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MSFT_audio_emitter", function() { return MSFT_audio_emitter; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MSFT_audio_emitter", function() { return MSFT_audio_emitter; });
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
|
|
|
|
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math.vector */ "babylonjs/Misc/tools");
|
|
|
|
+/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glTFLoader */ "./glTF/2.0/glTFLoader.ts");
|
|
/* harmony import */ var _glTFLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glTFLoader */ "./glTF/2.0/glTFLoader.ts");
|
|
|
|
|
|
|
|
|
|
@@ -3752,8 +3756,8 @@ var MSFT_audio_emitter = /** @class */ (function () {
|
|
var sound = _a[_i];
|
|
var sound = _a[_i];
|
|
sound.attachToMesh(babylonMesh);
|
|
sound.attachToMesh(babylonMesh);
|
|
if (emitter.innerAngle != undefined || emitter.outerAngle != undefined) {
|
|
if (emitter.innerAngle != undefined || emitter.outerAngle != undefined) {
|
|
- sound.setLocalDirectionToMesh(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Forward());
|
|
|
|
- sound.setDirectionalCone(2 * babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].ToDegrees(emitter.innerAngle == undefined ? Math.PI : emitter.innerAngle), 2 * babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].ToDegrees(emitter.outerAngle == undefined ? Math.PI : emitter.outerAngle), 0);
|
|
|
|
|
|
+ sound.setLocalDirectionToMesh(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Forward());
|
|
|
|
+ sound.setDirectionalCone(2 * babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Tools"].ToDegrees(emitter.innerAngle == undefined ? Math.PI : emitter.innerAngle), 2 * babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Tools"].ToDegrees(emitter.outerAngle == undefined ? Math.PI : emitter.outerAngle), 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}));
|
|
}));
|
|
@@ -3819,7 +3823,7 @@ var MSFT_audio_emitter = /** @class */ (function () {
|
|
var clipContext = "#/extensions/" + this_1.name + "/clips";
|
|
var clipContext = "#/extensions/" + this_1.name + "/clips";
|
|
var clip = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["ArrayItem"].Get(clipContext, this_1._clips, emitter.clips[i].clip);
|
|
var clip = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["ArrayItem"].Get(clipContext, this_1._clips, emitter.clips[i].clip);
|
|
clipPromises.push(this_1._loadClipAsync(clipContext + "/" + emitter.clips[i].clip, clip).then(function (objectURL) {
|
|
clipPromises.push(this_1._loadClipAsync(clipContext + "/" + emitter.clips[i].clip, clip).then(function (objectURL) {
|
|
- var sound = emitter._babylonSounds[i] = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Sound"](name_1, objectURL, _this._loader.babylonScene, null, options_1);
|
|
|
|
|
|
+ var sound = emitter._babylonSounds[i] = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Sound"](name_1, objectURL, _this._loader.babylonScene, null, options_1);
|
|
sound.refDistance = emitter.refDistance || 1;
|
|
sound.refDistance = emitter.refDistance || 1;
|
|
sound.maxDistance = emitter.maxDistance || 256;
|
|
sound.maxDistance = emitter.maxDistance || 256;
|
|
sound.rolloffFactor = emitter.rolloffFactor || 1;
|
|
sound.rolloffFactor = emitter.rolloffFactor || 1;
|
|
@@ -3833,12 +3837,12 @@ var MSFT_audio_emitter = /** @class */ (function () {
|
|
}
|
|
}
|
|
var promise = Promise.all(clipPromises).then(function () {
|
|
var promise = Promise.all(clipPromises).then(function () {
|
|
var weights = emitter.clips.map(function (clip) { return clip.weight || 1; });
|
|
var weights = emitter.clips.map(function (clip) { return clip.weight || 1; });
|
|
- var weightedSound = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["WeightedSound"](emitter.loop || false, emitter._babylonSounds, weights);
|
|
|
|
|
|
+ var weightedSound = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["WeightedSound"](emitter.loop || false, emitter._babylonSounds, weights);
|
|
if (emitter.innerAngle) {
|
|
if (emitter.innerAngle) {
|
|
- weightedSound.directionalConeInnerAngle = 2 * babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].ToDegrees(emitter.innerAngle);
|
|
|
|
|
|
+ weightedSound.directionalConeInnerAngle = 2 * babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Tools"].ToDegrees(emitter.innerAngle);
|
|
}
|
|
}
|
|
if (emitter.outerAngle) {
|
|
if (emitter.outerAngle) {
|
|
- weightedSound.directionalConeOuterAngle = 2 * babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].ToDegrees(emitter.outerAngle);
|
|
|
|
|
|
+ weightedSound.directionalConeOuterAngle = 2 * babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Tools"].ToDegrees(emitter.outerAngle);
|
|
}
|
|
}
|
|
if (emitter.volume) {
|
|
if (emitter.volume) {
|
|
weightedSound.volume = emitter.volume;
|
|
weightedSound.volume = emitter.volume;
|
|
@@ -3885,7 +3889,7 @@ var MSFT_audio_emitter = /** @class */ (function () {
|
|
return this._loadEmitterAsync(context, emitter).then(function () {
|
|
return this._loadEmitterAsync(context, emitter).then(function () {
|
|
var sound = emitter._babylonData.sound;
|
|
var sound = emitter._babylonData.sound;
|
|
if (sound) {
|
|
if (sound) {
|
|
- var babylonAnimationEvent = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["AnimationEvent"](event.time, _this._getEventAction(context, sound, event.action, event.time, event.startOffset));
|
|
|
|
|
|
+ var babylonAnimationEvent = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["AnimationEvent"](event.time, _this._getEventAction(context, sound, event.action, event.time, event.startOffset));
|
|
babylonAnimation.animation.addEvent(babylonAnimationEvent);
|
|
babylonAnimation.animation.addEvent(babylonAnimationEvent);
|
|
// Make sure all started audio stops when this animation is terminated.
|
|
// Make sure all started audio stops when this animation is terminated.
|
|
babylonAnimationGroup.onAnimationGroupEndObservable.add(function () {
|
|
babylonAnimationGroup.onAnimationGroupEndObservable.add(function () {
|
|
@@ -4465,6 +4469,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Helper class for working with arrays when loading the glTF asset
|
|
* Helper class for working with arrays when loading the glTF asset
|
|
*/
|
|
*/
|