@galacean/engine-loader 1.1.0-alpha.2 → 1.1.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/miniprogram.js
CHANGED
|
@@ -681,6 +681,8 @@ exports.InterpolableValueType = void 0;
|
|
|
681
681
|
InterpolableValueType[InterpolableValueType["Color"] = 6] = "Color";
|
|
682
682
|
InterpolableValueType[InterpolableValueType["Array"] = 7] = "Array";
|
|
683
683
|
InterpolableValueType[InterpolableValueType["Boolean"] = 8] = "Boolean";
|
|
684
|
+
InterpolableValueType[InterpolableValueType["Rect"] = 9] = "Rect";
|
|
685
|
+
InterpolableValueType[InterpolableValueType["ReferResource"] = 10] = "ReferResource";
|
|
684
686
|
})(exports.InterpolableValueType || (exports.InterpolableValueType = {}));
|
|
685
687
|
exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
686
688
|
function AnimationClipDecoder() {}
|
|
@@ -709,7 +711,7 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
709
711
|
switch(curveType){
|
|
710
712
|
case "AnimationFloatCurve":
|
|
711
713
|
{
|
|
712
|
-
curve =
|
|
714
|
+
curve = new miniprogram.AnimationFloatCurve();
|
|
713
715
|
curve.interpolation = interpolation;
|
|
714
716
|
for(var j = 0; j < keysLen; ++j){
|
|
715
717
|
var keyframe = new miniprogram.Keyframe();
|
|
@@ -723,7 +725,7 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
723
725
|
}
|
|
724
726
|
case "AnimationArrayCurve":
|
|
725
727
|
{
|
|
726
|
-
curve =
|
|
728
|
+
curve = new miniprogram.AnimationArrayCurve();
|
|
727
729
|
curve.interpolation = interpolation;
|
|
728
730
|
for(var j1 = 0; j1 < keysLen; ++j1){
|
|
729
731
|
var keyframe1 = new miniprogram.Keyframe();
|
|
@@ -738,7 +740,7 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
738
740
|
}
|
|
739
741
|
case "AnimationFloatArrayCurve":
|
|
740
742
|
{
|
|
741
|
-
curve =
|
|
743
|
+
curve = new miniprogram.AnimationFloatArrayCurve();
|
|
742
744
|
curve.interpolation = interpolation;
|
|
743
745
|
for(var j2 = 0; j2 < keysLen; ++j2){
|
|
744
746
|
var keyframe2 = new miniprogram.Keyframe();
|
|
@@ -753,7 +755,7 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
753
755
|
}
|
|
754
756
|
case "AnimationVector2Curve":
|
|
755
757
|
{
|
|
756
|
-
curve =
|
|
758
|
+
curve = new miniprogram.AnimationVector2Curve();
|
|
757
759
|
curve.interpolation = interpolation;
|
|
758
760
|
for(var j3 = 0; j3 < keysLen; ++j3){
|
|
759
761
|
var keyframe3 = new miniprogram.Keyframe();
|
|
@@ -767,7 +769,7 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
767
769
|
}
|
|
768
770
|
case "AnimationVector3Curve":
|
|
769
771
|
{
|
|
770
|
-
curve =
|
|
772
|
+
curve = new miniprogram.AnimationVector3Curve();
|
|
771
773
|
curve.interpolation = interpolation;
|
|
772
774
|
for(var j4 = 0; j4 < keysLen; ++j4){
|
|
773
775
|
var keyframe4 = new miniprogram.Keyframe();
|
|
@@ -781,7 +783,7 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
781
783
|
}
|
|
782
784
|
case "AnimationVector4Curve":
|
|
783
785
|
{
|
|
784
|
-
curve =
|
|
786
|
+
curve = new miniprogram.AnimationVector4Curve();
|
|
785
787
|
curve.interpolation = interpolation;
|
|
786
788
|
var keyframe5 = new miniprogram.Keyframe();
|
|
787
789
|
keyframe5.time = bufferReader.nextFloat32();
|
|
@@ -793,7 +795,7 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
793
795
|
}
|
|
794
796
|
case "AnimationColorCurve":
|
|
795
797
|
{
|
|
796
|
-
curve =
|
|
798
|
+
curve = new miniprogram.AnimationColorCurve();
|
|
797
799
|
curve.interpolation = interpolation;
|
|
798
800
|
for(var j5 = 0; j5 < keysLen; ++j5){
|
|
799
801
|
var keyframe6 = new miniprogram.Keyframe();
|
|
@@ -807,7 +809,7 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
807
809
|
}
|
|
808
810
|
case "AnimationQuaternionCurve":
|
|
809
811
|
{
|
|
810
|
-
curve =
|
|
812
|
+
curve = new miniprogram.AnimationQuaternionCurve();
|
|
811
813
|
curve.interpolation = interpolation;
|
|
812
814
|
for(var j6 = 0; j6 < keysLen; ++j6){
|
|
813
815
|
var keyframe7 = new miniprogram.Keyframe();
|
|
@@ -819,6 +821,18 @@ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
819
821
|
}
|
|
820
822
|
break;
|
|
821
823
|
}
|
|
824
|
+
case "AnimationRefCurve":
|
|
825
|
+
{
|
|
826
|
+
curve = new miniprogram.AnimationRefCurve();
|
|
827
|
+
curve.interpolation = interpolation;
|
|
828
|
+
for(var j7 = 0; j7 < keysLen; ++j7){
|
|
829
|
+
var keyframe8 = new miniprogram.Keyframe();
|
|
830
|
+
keyframe8.time = bufferReader.nextFloat32();
|
|
831
|
+
keyframe8.value = JSON.parse(bufferReader.nextStr());
|
|
832
|
+
curve.addKey(keyframe8);
|
|
833
|
+
}
|
|
834
|
+
break;
|
|
835
|
+
}
|
|
822
836
|
}
|
|
823
837
|
clip.addCurveBinding(relativePath, componentType, property, curve);
|
|
824
838
|
}
|
|
@@ -1066,7 +1080,27 @@ var AnimationClipLoader = /*#__PURE__*/ function(Loader) {
|
|
|
1066
1080
|
_this.request(item.url, _extends({}, item, {
|
|
1067
1081
|
type: "arraybuffer"
|
|
1068
1082
|
})).then(function(data) {
|
|
1069
|
-
return decode(data, resourceManager.engine).then(
|
|
1083
|
+
return decode(data, resourceManager.engine).then(function(clip) {
|
|
1084
|
+
var curveBindingPromises = clip.curveBindings.map(function(curveBinding) {
|
|
1085
|
+
var curve = curveBinding.curve;
|
|
1086
|
+
var promises = curve.keys.map(function(key) {
|
|
1087
|
+
var value = key.value;
|
|
1088
|
+
if (typeof value === "object" && value.refId) {
|
|
1089
|
+
return new Promise(function(resolve) {
|
|
1090
|
+
resourceManager// @ts-ignore
|
|
1091
|
+
.getResourceByRef(value).then(function(asset) {
|
|
1092
|
+
key.value = asset;
|
|
1093
|
+
resolve(key);
|
|
1094
|
+
}).catch(reject);
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
});
|
|
1098
|
+
return Promise.all(promises);
|
|
1099
|
+
});
|
|
1100
|
+
return Promise.all(curveBindingPromises).then(function() {
|
|
1101
|
+
resolve(clip);
|
|
1102
|
+
});
|
|
1103
|
+
});
|
|
1070
1104
|
}).catch(reject);
|
|
1071
1105
|
});
|
|
1072
1106
|
};
|
|
@@ -3608,16 +3642,16 @@ exports.GLTFBufferParser = __decorate([
|
|
|
3608
3642
|
registerGLTFParser(exports.GLTFParserType.Buffer)
|
|
3609
3643
|
], exports.GLTFBufferParser);
|
|
3610
3644
|
|
|
3611
|
-
exports.GLTFEntityParser = /*#__PURE__*/ function(
|
|
3612
|
-
_inherits(GLTFEntityParser,
|
|
3645
|
+
exports.GLTFEntityParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
3646
|
+
_inherits(GLTFEntityParser, GLTFParser1);
|
|
3613
3647
|
function GLTFEntityParser() {
|
|
3614
|
-
return
|
|
3648
|
+
return GLTFParser1.apply(this, arguments);
|
|
3615
3649
|
}
|
|
3616
3650
|
var _proto = GLTFEntityParser.prototype;
|
|
3617
3651
|
_proto.parse = function parse(context, index) {
|
|
3618
3652
|
var entityInfo = context.glTF.nodes[index];
|
|
3619
3653
|
var engine = context.glTFResource.engine;
|
|
3620
|
-
var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale;
|
|
3654
|
+
var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale, extensions = entityInfo.extensions;
|
|
3621
3655
|
var entity = new miniprogram.Entity(engine, entityInfo.name || "_GLTF_ENTITY_" + index);
|
|
3622
3656
|
var transform = entity.transform;
|
|
3623
3657
|
if (matrix) {
|
|
@@ -3643,6 +3677,7 @@ exports.GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
|
|
|
3643
3677
|
entity.addChild(childEntity);
|
|
3644
3678
|
}
|
|
3645
3679
|
}
|
|
3680
|
+
GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);
|
|
3646
3681
|
return entity;
|
|
3647
3682
|
};
|
|
3648
3683
|
return GLTFEntityParser;
|
|
@@ -4041,7 +4076,7 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4041
4076
|
var _this = this;
|
|
4042
4077
|
var glTF = context.glTF, glTFResource = context.glTFResource;
|
|
4043
4078
|
var entityInfo = glTF.nodes[index];
|
|
4044
|
-
var cameraID = entityInfo.camera, meshID = entityInfo.mesh
|
|
4079
|
+
var cameraID = entityInfo.camera, meshID = entityInfo.mesh;
|
|
4045
4080
|
var entity = context.get(exports.GLTFParserType.Entity, index);
|
|
4046
4081
|
var promise;
|
|
4047
4082
|
if (cameraID !== undefined) {
|
|
@@ -4058,7 +4093,6 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4058
4093
|
promises.push(_this._parseEntityComponent(context, children[i]));
|
|
4059
4094
|
}
|
|
4060
4095
|
}
|
|
4061
|
-
GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);
|
|
4062
4096
|
return Promise.all(promises);
|
|
4063
4097
|
});
|
|
4064
4098
|
};
|
|
@@ -5434,8 +5468,6 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
|
|
|
5434
5468
|
_this.request(item.url, {
|
|
5435
5469
|
type: "json"
|
|
5436
5470
|
}).then(function(data) {
|
|
5437
|
-
// @ts-ignore
|
|
5438
|
-
engine.resourceManager.initVirtualResources(data.files);
|
|
5439
5471
|
return SceneParser.parse(engine, data).then(function(scene) {
|
|
5440
5472
|
var promises = [];
|
|
5441
5473
|
// parse ambient light
|
|
@@ -5463,6 +5495,10 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
|
|
|
5463
5495
|
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
5464
5496
|
});
|
|
5465
5497
|
promises.push(ambientLightPromise);
|
|
5498
|
+
} else {
|
|
5499
|
+
scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
|
|
5500
|
+
scene.ambientLight.specularIntensity = ambient.specularIntensity;
|
|
5501
|
+
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
5466
5502
|
}
|
|
5467
5503
|
var background = data.scene.background;
|
|
5468
5504
|
scene.background.mode = background.mode;
|
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Utils, ModelMesh, BlendShape, Texture2D, Entity, Loader, Transform, Animator, DirectLight, Camera, MeshRenderer, ParticleRenderer, PointLight, SpotLight, Script, SpriteMask, SpriteRenderer, TextRenderer, AnimationClip, AnimationEvent,
|
|
1
|
+
import { Utils, ModelMesh, BlendShape, Texture2D, Entity, Loader, Transform, Animator, DirectLight, Camera, MeshRenderer, ParticleRenderer, PointLight, SpotLight, Script, SpriteMask, SpriteRenderer, TextRenderer, AnimationClip, AnimationEvent, AnimationRefCurve, Keyframe, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, Scene, resourceLoader, AssetPromise, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateMachine, AnimatorStateTransition, TextureCube, TextureFilterMode, TextureCubeFace, AmbientLight, DiffuseMode, Font, ReferResource, IndexFormat, VertexElementFormat, GLCapabilityType, Logger, TextureFormat, request, ContentRestorer, InterpolationType, SkinnedMeshRenderer, PBRMaterial, BlinnPhongMaterial, PBRSpecularMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Skin, TextureWrapMode as TextureWrapMode$1, Material, Shader, SpriteAtlas, Sprite, BackgroundMode, UnlitMaterial } from '@galacean/engine-core';
|
|
2
2
|
import { Color, Vector4, Vector3, Vector2, Quaternion, SphericalHarmonics3, MathUtil, BoundingBox, Matrix, Rect } from '@galacean/engine-math';
|
|
3
3
|
import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
|
|
4
4
|
import { DRACODecoder } from '@galacean/engine-draco';
|
|
@@ -676,6 +676,8 @@ var InterpolableValueType;
|
|
|
676
676
|
InterpolableValueType[InterpolableValueType["Color"] = 6] = "Color";
|
|
677
677
|
InterpolableValueType[InterpolableValueType["Array"] = 7] = "Array";
|
|
678
678
|
InterpolableValueType[InterpolableValueType["Boolean"] = 8] = "Boolean";
|
|
679
|
+
InterpolableValueType[InterpolableValueType["Rect"] = 9] = "Rect";
|
|
680
|
+
InterpolableValueType[InterpolableValueType["ReferResource"] = 10] = "ReferResource";
|
|
679
681
|
})(InterpolableValueType || (InterpolableValueType = {}));
|
|
680
682
|
var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
681
683
|
function AnimationClipDecoder() {}
|
|
@@ -704,7 +706,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
704
706
|
switch(curveType){
|
|
705
707
|
case "AnimationFloatCurve":
|
|
706
708
|
{
|
|
707
|
-
curve =
|
|
709
|
+
curve = new AnimationFloatCurve();
|
|
708
710
|
curve.interpolation = interpolation;
|
|
709
711
|
for(var j = 0; j < keysLen; ++j){
|
|
710
712
|
var keyframe = new Keyframe();
|
|
@@ -718,7 +720,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
718
720
|
}
|
|
719
721
|
case "AnimationArrayCurve":
|
|
720
722
|
{
|
|
721
|
-
curve =
|
|
723
|
+
curve = new AnimationArrayCurve();
|
|
722
724
|
curve.interpolation = interpolation;
|
|
723
725
|
for(var j1 = 0; j1 < keysLen; ++j1){
|
|
724
726
|
var keyframe1 = new Keyframe();
|
|
@@ -733,7 +735,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
733
735
|
}
|
|
734
736
|
case "AnimationFloatArrayCurve":
|
|
735
737
|
{
|
|
736
|
-
curve =
|
|
738
|
+
curve = new AnimationFloatArrayCurve();
|
|
737
739
|
curve.interpolation = interpolation;
|
|
738
740
|
for(var j2 = 0; j2 < keysLen; ++j2){
|
|
739
741
|
var keyframe2 = new Keyframe();
|
|
@@ -748,7 +750,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
748
750
|
}
|
|
749
751
|
case "AnimationVector2Curve":
|
|
750
752
|
{
|
|
751
|
-
curve =
|
|
753
|
+
curve = new AnimationVector2Curve();
|
|
752
754
|
curve.interpolation = interpolation;
|
|
753
755
|
for(var j3 = 0; j3 < keysLen; ++j3){
|
|
754
756
|
var keyframe3 = new Keyframe();
|
|
@@ -762,7 +764,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
762
764
|
}
|
|
763
765
|
case "AnimationVector3Curve":
|
|
764
766
|
{
|
|
765
|
-
curve =
|
|
767
|
+
curve = new AnimationVector3Curve();
|
|
766
768
|
curve.interpolation = interpolation;
|
|
767
769
|
for(var j4 = 0; j4 < keysLen; ++j4){
|
|
768
770
|
var keyframe4 = new Keyframe();
|
|
@@ -776,7 +778,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
776
778
|
}
|
|
777
779
|
case "AnimationVector4Curve":
|
|
778
780
|
{
|
|
779
|
-
curve =
|
|
781
|
+
curve = new AnimationVector4Curve();
|
|
780
782
|
curve.interpolation = interpolation;
|
|
781
783
|
var keyframe5 = new Keyframe();
|
|
782
784
|
keyframe5.time = bufferReader.nextFloat32();
|
|
@@ -788,7 +790,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
788
790
|
}
|
|
789
791
|
case "AnimationColorCurve":
|
|
790
792
|
{
|
|
791
|
-
curve =
|
|
793
|
+
curve = new AnimationColorCurve();
|
|
792
794
|
curve.interpolation = interpolation;
|
|
793
795
|
for(var j5 = 0; j5 < keysLen; ++j5){
|
|
794
796
|
var keyframe6 = new Keyframe();
|
|
@@ -802,7 +804,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
802
804
|
}
|
|
803
805
|
case "AnimationQuaternionCurve":
|
|
804
806
|
{
|
|
805
|
-
curve =
|
|
807
|
+
curve = new AnimationQuaternionCurve();
|
|
806
808
|
curve.interpolation = interpolation;
|
|
807
809
|
for(var j6 = 0; j6 < keysLen; ++j6){
|
|
808
810
|
var keyframe7 = new Keyframe();
|
|
@@ -814,6 +816,18 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
814
816
|
}
|
|
815
817
|
break;
|
|
816
818
|
}
|
|
819
|
+
case "AnimationRefCurve":
|
|
820
|
+
{
|
|
821
|
+
curve = new AnimationRefCurve();
|
|
822
|
+
curve.interpolation = interpolation;
|
|
823
|
+
for(var j7 = 0; j7 < keysLen; ++j7){
|
|
824
|
+
var keyframe8 = new Keyframe();
|
|
825
|
+
keyframe8.time = bufferReader.nextFloat32();
|
|
826
|
+
keyframe8.value = JSON.parse(bufferReader.nextStr());
|
|
827
|
+
curve.addKey(keyframe8);
|
|
828
|
+
}
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
817
831
|
}
|
|
818
832
|
clip.addCurveBinding(relativePath, componentType, property, curve);
|
|
819
833
|
}
|
|
@@ -1061,7 +1075,27 @@ var AnimationClipLoader = /*#__PURE__*/ function(Loader) {
|
|
|
1061
1075
|
_this.request(item.url, _extends({}, item, {
|
|
1062
1076
|
type: "arraybuffer"
|
|
1063
1077
|
})).then(function(data) {
|
|
1064
|
-
return decode(data, resourceManager.engine).then(
|
|
1078
|
+
return decode(data, resourceManager.engine).then(function(clip) {
|
|
1079
|
+
var curveBindingPromises = clip.curveBindings.map(function(curveBinding) {
|
|
1080
|
+
var curve = curveBinding.curve;
|
|
1081
|
+
var promises = curve.keys.map(function(key) {
|
|
1082
|
+
var value = key.value;
|
|
1083
|
+
if (typeof value === "object" && value.refId) {
|
|
1084
|
+
return new Promise(function(resolve) {
|
|
1085
|
+
resourceManager// @ts-ignore
|
|
1086
|
+
.getResourceByRef(value).then(function(asset) {
|
|
1087
|
+
key.value = asset;
|
|
1088
|
+
resolve(key);
|
|
1089
|
+
}).catch(reject);
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
return Promise.all(promises);
|
|
1094
|
+
});
|
|
1095
|
+
return Promise.all(curveBindingPromises).then(function() {
|
|
1096
|
+
resolve(clip);
|
|
1097
|
+
});
|
|
1098
|
+
});
|
|
1065
1099
|
}).catch(reject);
|
|
1066
1100
|
});
|
|
1067
1101
|
};
|
|
@@ -3603,16 +3637,16 @@ GLTFBufferParser = __decorate([
|
|
|
3603
3637
|
registerGLTFParser(GLTFParserType.Buffer)
|
|
3604
3638
|
], GLTFBufferParser);
|
|
3605
3639
|
|
|
3606
|
-
var GLTFEntityParser = /*#__PURE__*/ function(
|
|
3607
|
-
_inherits(GLTFEntityParser,
|
|
3640
|
+
var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
3641
|
+
_inherits(GLTFEntityParser, GLTFParser1);
|
|
3608
3642
|
function GLTFEntityParser() {
|
|
3609
|
-
return
|
|
3643
|
+
return GLTFParser1.apply(this, arguments);
|
|
3610
3644
|
}
|
|
3611
3645
|
var _proto = GLTFEntityParser.prototype;
|
|
3612
3646
|
_proto.parse = function parse(context, index) {
|
|
3613
3647
|
var entityInfo = context.glTF.nodes[index];
|
|
3614
3648
|
var engine = context.glTFResource.engine;
|
|
3615
|
-
var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale;
|
|
3649
|
+
var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale, extensions = entityInfo.extensions;
|
|
3616
3650
|
var entity = new Entity(engine, entityInfo.name || "_GLTF_ENTITY_" + index);
|
|
3617
3651
|
var transform = entity.transform;
|
|
3618
3652
|
if (matrix) {
|
|
@@ -3638,6 +3672,7 @@ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
|
|
|
3638
3672
|
entity.addChild(childEntity);
|
|
3639
3673
|
}
|
|
3640
3674
|
}
|
|
3675
|
+
GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);
|
|
3641
3676
|
return entity;
|
|
3642
3677
|
};
|
|
3643
3678
|
return GLTFEntityParser;
|
|
@@ -4036,7 +4071,7 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4036
4071
|
var _this = this;
|
|
4037
4072
|
var glTF = context.glTF, glTFResource = context.glTFResource;
|
|
4038
4073
|
var entityInfo = glTF.nodes[index];
|
|
4039
|
-
var cameraID = entityInfo.camera, meshID = entityInfo.mesh
|
|
4074
|
+
var cameraID = entityInfo.camera, meshID = entityInfo.mesh;
|
|
4040
4075
|
var entity = context.get(GLTFParserType.Entity, index);
|
|
4041
4076
|
var promise;
|
|
4042
4077
|
if (cameraID !== undefined) {
|
|
@@ -4053,7 +4088,6 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4053
4088
|
promises.push(_this._parseEntityComponent(context, children[i]));
|
|
4054
4089
|
}
|
|
4055
4090
|
}
|
|
4056
|
-
GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);
|
|
4057
4091
|
return Promise.all(promises);
|
|
4058
4092
|
});
|
|
4059
4093
|
};
|
|
@@ -5429,8 +5463,6 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
|
|
|
5429
5463
|
_this.request(item.url, {
|
|
5430
5464
|
type: "json"
|
|
5431
5465
|
}).then(function(data) {
|
|
5432
|
-
// @ts-ignore
|
|
5433
|
-
engine.resourceManager.initVirtualResources(data.files);
|
|
5434
5466
|
return SceneParser.parse(engine, data).then(function(scene) {
|
|
5435
5467
|
var promises = [];
|
|
5436
5468
|
// parse ambient light
|
|
@@ -5458,6 +5490,10 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
|
|
|
5458
5490
|
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
5459
5491
|
});
|
|
5460
5492
|
promises.push(ambientLightPromise);
|
|
5493
|
+
} else {
|
|
5494
|
+
scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
|
|
5495
|
+
scene.ambientLight.specularIntensity = ambient.specularIntensity;
|
|
5496
|
+
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
5461
5497
|
}
|
|
5462
5498
|
var background = data.scene.background;
|
|
5463
5499
|
scene.background.mode = background.mode;
|