@galacean/effects-core 2.10.0-alpha.5 → 2.10.0
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/index.js +135 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +135 -69
- package/dist/index.mjs.map +1 -1
- package/dist/render/text-cache.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.10.0
|
|
6
|
+
* Version: v2.10.0
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2228,10 +2228,10 @@ var Color = /*#__PURE__*/ function() {
|
|
|
2228
2228
|
};
|
|
2229
2229
|
_proto.toHexString = function toHexString(includeAlpha) {
|
|
2230
2230
|
if (includeAlpha === void 0) includeAlpha = true;
|
|
2231
|
-
var R = Color.ToHex(Math.round(this.r * 255));
|
|
2232
|
-
var G = Color.ToHex(Math.round(this.g * 255));
|
|
2233
|
-
var B = Color.ToHex(Math.round(this.b * 255));
|
|
2234
|
-
var A = Color.ToHex(Math.round(this.a * 255));
|
|
2231
|
+
var R = Color.ToHex(Math.round(Math.min(Math.max(this.r, 0), 1) * 255));
|
|
2232
|
+
var G = Color.ToHex(Math.round(Math.min(Math.max(this.g, 0), 1) * 255));
|
|
2233
|
+
var B = Color.ToHex(Math.round(Math.min(Math.max(this.b, 0), 1) * 255));
|
|
2234
|
+
var A = Color.ToHex(Math.round(Math.min(Math.max(this.a, 0), 1) * 255));
|
|
2235
2235
|
if (includeAlpha) {
|
|
2236
2236
|
return "#" + R + G + B + A;
|
|
2237
2237
|
} else {
|
|
@@ -2277,30 +2277,14 @@ var Color = /*#__PURE__*/ function() {
|
|
|
2277
2277
|
* @param v - Gamma 空间颜色值
|
|
2278
2278
|
* @returns 线性空间颜色值
|
|
2279
2279
|
*/ Color.gammaToLinear = function gammaToLinear(v) {
|
|
2280
|
-
|
|
2281
|
-
return 0.0;
|
|
2282
|
-
} else if (v <= 0.04045) {
|
|
2283
|
-
return v / 12.92;
|
|
2284
|
-
} else if (v < 1.0) {
|
|
2285
|
-
return Math.pow((v + 0.055) / 1.055, 2.4);
|
|
2286
|
-
} else {
|
|
2287
|
-
return Math.pow(v, 2.4);
|
|
2288
|
-
}
|
|
2280
|
+
return v < 0.04045 ? v * 0.0773993808 : Math.pow(v * 0.9478672986 + 0.0521327014, 2.4);
|
|
2289
2281
|
};
|
|
2290
2282
|
/**
|
|
2291
2283
|
* 颜色值从线性空间转到 Gamma 空间
|
|
2292
2284
|
* @param value - 线性空间颜色值
|
|
2293
2285
|
* @returns Gamma 空间颜色值
|
|
2294
2286
|
*/ Color.linearToGamma = function linearToGamma(value) {
|
|
2295
|
-
|
|
2296
|
-
return 0.0;
|
|
2297
|
-
} else if (value < 0.0031308) {
|
|
2298
|
-
return 12.92 * value;
|
|
2299
|
-
} else if (value < 1.0) {
|
|
2300
|
-
return 1.055 * Math.pow(value, 0.41666) - 0.055;
|
|
2301
|
-
} else {
|
|
2302
|
-
return Math.pow(value, 0.41666);
|
|
2303
|
-
}
|
|
2287
|
+
return value < 0.0031308 ? value * 12.92 : 1.055 * Math.pow(value, 0.41666) - 0.055;
|
|
2304
2288
|
};
|
|
2305
2289
|
Color.ToHex = function ToHex(i) {
|
|
2306
2290
|
var str = i.toString(16);
|
|
@@ -3098,7 +3082,8 @@ function _inherits(subClass, superClass) {
|
|
|
3098
3082
|
JSONSceneVersion["3_5"] = "3.5";
|
|
3099
3083
|
JSONSceneVersion["3_6"] = "3.6";
|
|
3100
3084
|
JSONSceneVersion["3_7"] = "3.7";
|
|
3101
|
-
JSONSceneVersion["
|
|
3085
|
+
JSONSceneVersion["3_8"] = "3.8";
|
|
3086
|
+
JSONSceneVersion["LATEST"] = "3.8";
|
|
3102
3087
|
})(JSONSceneVersion || (JSONSceneVersion = {}));
|
|
3103
3088
|
|
|
3104
3089
|
/*********************************************/ /* 元素属性参数类型 */ /*********************************************/ /**
|
|
@@ -3494,6 +3479,9 @@ var CameraClipMode;
|
|
|
3494
3479
|
/**
|
|
3495
3480
|
* Vector3 曲线
|
|
3496
3481
|
*/ ValueType[ValueType["VECTOR3_CURVE"] = 27] = "VECTOR3_CURVE";
|
|
3482
|
+
/**
|
|
3483
|
+
* 对象引用阶梯曲线(不插值)
|
|
3484
|
+
*/ ValueType[ValueType["REFERENCE_CURVE"] = 28] = "REFERENCE_CURVE";
|
|
3497
3485
|
})(ValueType || (ValueType = {}));
|
|
3498
3486
|
/**
|
|
3499
3487
|
* 关键帧类型
|
|
@@ -3737,6 +3725,15 @@ var BuiltinObjectGUID = {
|
|
|
3737
3725
|
UnlitShader: "unlit000000000000000000000000000"
|
|
3738
3726
|
};
|
|
3739
3727
|
|
|
3728
|
+
/**
|
|
3729
|
+
* Sprite UV 旋转方式。序列化为整数(兼容老 splits 的 flip 0/1)。
|
|
3730
|
+
* None 不旋转、Rotate90 将 UV 顺时针旋转 90°(width/height 互换)。
|
|
3731
|
+
*/ var SpriteRotation$1;
|
|
3732
|
+
(function(SpriteRotation) {
|
|
3733
|
+
/** 不旋转 */ SpriteRotation[SpriteRotation["None"] = 0] = "None";
|
|
3734
|
+
/** UV 旋转 90°(对应老 splits flip=1) */ SpriteRotation[SpriteRotation["Rotate90"] = 1] = "Rotate90";
|
|
3735
|
+
})(SpriteRotation$1 || (SpriteRotation$1 = {}));
|
|
3736
|
+
|
|
3740
3737
|
var FillType;
|
|
3741
3738
|
(function(FillType) {
|
|
3742
3739
|
FillType[FillType["Solid"] = 0] = "Solid";
|
|
@@ -3848,6 +3845,7 @@ var DataType;
|
|
|
3848
3845
|
DataType["Image"] = "Image";
|
|
3849
3846
|
DataType["AnimationClip"] = "AnimationClip";
|
|
3850
3847
|
DataType["BinaryAsset"] = "BinaryAsset";
|
|
3848
|
+
DataType["Sprite"] = "Sprite";
|
|
3851
3849
|
// Timeline
|
|
3852
3850
|
DataType["TrackAsset"] = "TrackAsset";
|
|
3853
3851
|
DataType["TimelineAsset"] = "TimelineAsset";
|
|
@@ -3861,6 +3859,7 @@ var DataType;
|
|
|
3861
3859
|
DataType["Vector2PropertyTrack"] = "Vector2PropertyTrack";
|
|
3862
3860
|
DataType["Vector3PropertyTrack"] = "Vector3PropertyTrack";
|
|
3863
3861
|
DataType["Vector4PropertyTrack"] = "Vector4PropertyTrack";
|
|
3862
|
+
DataType["SpritePropertyTrack"] = "SpritePropertyTrack";
|
|
3864
3863
|
DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
|
|
3865
3864
|
DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
|
|
3866
3865
|
DataType["ActivationPlayableAsset"] = "ActivationPlayableAsset";
|
|
@@ -3870,6 +3869,7 @@ var DataType;
|
|
|
3870
3869
|
DataType["Vector2PropertyPlayableAsset"] = "Vector2PropertyPlayableAsset";
|
|
3871
3870
|
DataType["Vector3PropertyPlayableAsset"] = "Vector3PropertyPlayableAsset";
|
|
3872
3871
|
DataType["Vector4PropertyPlayableAsset"] = "Vector4PropertyPlayableAsset";
|
|
3872
|
+
DataType["SpritePropertyPlayableAsset"] = "SpritePropertyPlayableAsset";
|
|
3873
3873
|
// Components
|
|
3874
3874
|
DataType["MeshComponent"] = "MeshComponent";
|
|
3875
3875
|
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
@@ -3896,6 +3896,42 @@ var DataType;
|
|
|
3896
3896
|
DataType["FFDComponent"] = "FFDComponent";
|
|
3897
3897
|
DataType["FrameComponent"] = "FrameComponent";
|
|
3898
3898
|
DataType["Animator"] = "Animator";
|
|
3899
|
+
DataType["DomContentComponent"] = "DomContentComponent";
|
|
3900
|
+
DataType["UIControl"] = "UIControl";
|
|
3901
|
+
// GUI Controls
|
|
3902
|
+
DataType["Control"] = "Control";
|
|
3903
|
+
DataType["Container"] = "Container";
|
|
3904
|
+
DataType["HBoxContainer"] = "HBoxContainer";
|
|
3905
|
+
DataType["VBoxContainer"] = "VBoxContainer";
|
|
3906
|
+
DataType["GridContainer"] = "GridContainer";
|
|
3907
|
+
DataType["PanelContainer"] = "PanelContainer";
|
|
3908
|
+
DataType["MarginContainer"] = "MarginContainer";
|
|
3909
|
+
DataType["CenterContainer"] = "CenterContainer";
|
|
3910
|
+
DataType["AspectRatioContainer"] = "AspectRatioContainer";
|
|
3911
|
+
DataType["ScrollContainer"] = "ScrollContainer";
|
|
3912
|
+
DataType["HScrollBar"] = "HScrollBar";
|
|
3913
|
+
DataType["VScrollBar"] = "VScrollBar";
|
|
3914
|
+
DataType["HSeparator"] = "HSeparator";
|
|
3915
|
+
DataType["VSeparator"] = "VSeparator";
|
|
3916
|
+
DataType["Label"] = "Label";
|
|
3917
|
+
DataType["LineEdit"] = "LineEdit";
|
|
3918
|
+
DataType["TextEdit"] = "TextEdit";
|
|
3919
|
+
DataType["PopupPanel"] = "PopupPanel";
|
|
3920
|
+
DataType["PopupMenu"] = "PopupMenu";
|
|
3921
|
+
DataType["MenuButton"] = "MenuButton";
|
|
3922
|
+
DataType["OptionButton"] = "OptionButton";
|
|
3923
|
+
DataType["ColorPicker"] = "ColorPicker";
|
|
3924
|
+
DataType["ColorPickerButton"] = "ColorPickerButton";
|
|
3925
|
+
DataType["TextureRect"] = "TextureRect";
|
|
3926
|
+
DataType["NinePatchRect"] = "NinePatchRect";
|
|
3927
|
+
DataType["ColorRect"] = "ColorRect";
|
|
3928
|
+
DataType["Panel"] = "Panel";
|
|
3929
|
+
DataType["ProgressBar"] = "ProgressBar";
|
|
3930
|
+
DataType["Button"] = "Button";
|
|
3931
|
+
DataType["Checkbox"] = "Checkbox";
|
|
3932
|
+
DataType["CheckButton"] = "CheckButton";
|
|
3933
|
+
DataType["HSlider"] = "HSlider";
|
|
3934
|
+
DataType["VSlider"] = "VSlider";
|
|
3899
3935
|
// Non-EffectObject
|
|
3900
3936
|
DataType["TimelineClip"] = "TimelineClip";
|
|
3901
3937
|
})(DataType || (DataType = {}));
|
|
@@ -4034,6 +4070,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4034
4070
|
get TextWeight () { return TextWeight; },
|
|
4035
4071
|
get FontStyle () { return FontStyle; },
|
|
4036
4072
|
BuiltinObjectGUID: BuiltinObjectGUID,
|
|
4073
|
+
get SpriteRotation () { return SpriteRotation$1; },
|
|
4037
4074
|
get FillType () { return FillType; },
|
|
4038
4075
|
get TexturePaintScaleMode () { return TexturePaintScaleMode$1; },
|
|
4039
4076
|
get ShapePrimitiveType () { return ShapePrimitiveType; },
|
|
@@ -9210,7 +9247,7 @@ function isUniformStructArray(value) {
|
|
|
9210
9247
|
return v.set(this.elements[i * 4], this.elements[i * 4 + 1], this.elements[i * 4 + 2], this.elements[i * 4 + 3]);
|
|
9211
9248
|
};
|
|
9212
9249
|
/**
|
|
9213
|
-
*
|
|
9250
|
+
* 设置矩阵的朝向旋转部分
|
|
9214
9251
|
* @param eye - 相机位置
|
|
9215
9252
|
* @param target - 目标位置
|
|
9216
9253
|
* @param up - 相机方向
|
|
@@ -9220,27 +9257,32 @@ function isUniformStructArray(value) {
|
|
|
9220
9257
|
var vY = Matrix4.tempVec1;
|
|
9221
9258
|
var vZ = Matrix4.tempVec2;
|
|
9222
9259
|
vZ.subtractVectors(eye, target);
|
|
9260
|
+
if (vZ.lengthSquared() === 0) {
|
|
9261
|
+
vZ.z = 1;
|
|
9262
|
+
}
|
|
9223
9263
|
vZ.normalize();
|
|
9224
9264
|
vX.crossVectors(up, vZ);
|
|
9265
|
+
if (vX.lengthSquared() === 0) {
|
|
9266
|
+
if (Math.abs(up.z) === 1) {
|
|
9267
|
+
vZ.x += 0.0001;
|
|
9268
|
+
} else {
|
|
9269
|
+
vZ.z += 0.0001;
|
|
9270
|
+
}
|
|
9271
|
+
vZ.normalize();
|
|
9272
|
+
vX.crossVectors(up, vZ);
|
|
9273
|
+
}
|
|
9225
9274
|
vX.normalize();
|
|
9226
9275
|
vY.crossVectors(vZ, vX);
|
|
9227
9276
|
var te = this.elements;
|
|
9228
9277
|
te[0] = vX.x;
|
|
9229
|
-
te[
|
|
9230
|
-
te[
|
|
9231
|
-
te[
|
|
9232
|
-
te[4] = vX.y;
|
|
9278
|
+
te[4] = vY.x;
|
|
9279
|
+
te[8] = vZ.x;
|
|
9280
|
+
te[1] = vX.y;
|
|
9233
9281
|
te[5] = vY.y;
|
|
9234
|
-
te[
|
|
9235
|
-
te[
|
|
9236
|
-
te[
|
|
9237
|
-
te[9] = vY.z;
|
|
9282
|
+
te[9] = vZ.y;
|
|
9283
|
+
te[2] = vX.z;
|
|
9284
|
+
te[6] = vY.z;
|
|
9238
9285
|
te[10] = vZ.z;
|
|
9239
|
-
te[11] = 0;
|
|
9240
|
-
te[12] = -vX.dot(eye);
|
|
9241
|
-
te[13] = -vY.dot(eye);
|
|
9242
|
-
te[14] = -vZ.dot(eye);
|
|
9243
|
-
te[15] = 1;
|
|
9244
9286
|
return this;
|
|
9245
9287
|
};
|
|
9246
9288
|
/**
|
|
@@ -9466,6 +9508,7 @@ function isUniformStructArray(value) {
|
|
|
9466
9508
|
te[12] = l * te[0] + m * te[4] + n * te[8] - l + translation.x;
|
|
9467
9509
|
te[13] = l * te[1] + m * te[5] + n * te[9] - m + translation.y;
|
|
9468
9510
|
te[14] = l * te[2] + m * te[6] + n * te[10] - n + translation.z;
|
|
9511
|
+
te[15] = 1;
|
|
9469
9512
|
return this;
|
|
9470
9513
|
};
|
|
9471
9514
|
/**
|
|
@@ -9757,7 +9800,7 @@ function isUniformStructArray(value) {
|
|
|
9757
9800
|
return new Matrix4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
9758
9801
|
};
|
|
9759
9802
|
/**
|
|
9760
|
-
*
|
|
9803
|
+
* 创建朝向旋转矩阵
|
|
9761
9804
|
* @param eye - 相机位置
|
|
9762
9805
|
* @param target - 目标位置
|
|
9763
9806
|
* @param up - 相机方向
|
|
@@ -10972,6 +11015,9 @@ Euler.tempMat0 = new Matrix4();
|
|
|
10972
11015
|
* @param [out] - 交点
|
|
10973
11016
|
* @returns
|
|
10974
11017
|
*/ _proto.intersectSphere = function intersectSphere(sphere, out) {
|
|
11018
|
+
if (sphere.radius < 0) {
|
|
11019
|
+
return;
|
|
11020
|
+
}
|
|
10975
11021
|
var center = sphere.center;
|
|
10976
11022
|
var vector = Ray.tempVec0.subtractVectors(center, this.origin);
|
|
10977
11023
|
var tca = vector.dot(this.direction);
|
|
@@ -11298,7 +11344,7 @@ Ray.tempVec3 = new Vector3();
|
|
|
11298
11344
|
* @returns
|
|
11299
11345
|
*/ _proto.intersectsSphere = function intersectsSphere(sphere) {
|
|
11300
11346
|
// Find the point on the AABB closest to the sphere center.
|
|
11301
|
-
var vector =
|
|
11347
|
+
var vector = Box3.tempVec0;
|
|
11302
11348
|
this.clampPoint(sphere.center, vector);
|
|
11303
11349
|
// If that point is inside the sphere, the AABB and sphere intersect.
|
|
11304
11350
|
return vector.distanceSquared(sphere.center) <= sphere.radius * sphere.radius;
|
|
@@ -11384,9 +11430,11 @@ Ray.tempVec3 = new Vector3();
|
|
|
11384
11430
|
* @param target
|
|
11385
11431
|
* @returns
|
|
11386
11432
|
*/ _proto.getBoundingSphere = function getBoundingSphere(target) {
|
|
11433
|
+
if (this.isEmpty()) {
|
|
11434
|
+
return target.makeEmpty();
|
|
11435
|
+
}
|
|
11387
11436
|
this.getCenter(target.center);
|
|
11388
|
-
|
|
11389
|
-
target.radius = this.getSize(vector).length() * 0.5;
|
|
11437
|
+
target.radius = this.getSize(Box3.tempVec0).length() * 0.5;
|
|
11390
11438
|
return target;
|
|
11391
11439
|
};
|
|
11392
11440
|
/**
|
|
@@ -11407,6 +11455,7 @@ Ray.tempVec3 = new Vector3();
|
|
|
11407
11455
|
};
|
|
11408
11456
|
return Box3;
|
|
11409
11457
|
}();
|
|
11458
|
+
Box3.tempVec0 = new Vector3();
|
|
11410
11459
|
|
|
11411
11460
|
/**
|
|
11412
11461
|
* 球
|
|
@@ -11437,16 +11486,15 @@ Ray.tempVec3 = new Vector3();
|
|
|
11437
11486
|
var center = this.center;
|
|
11438
11487
|
if (optionalCenter !== undefined) {
|
|
11439
11488
|
center.copyFrom(optionalCenter);
|
|
11440
|
-
var maxRadiusSq = 0;
|
|
11441
|
-
for(var i = 0; i < points.length; i++){
|
|
11442
|
-
maxRadiusSq = Math.max(maxRadiusSq, center.distanceSquared(points[i]));
|
|
11443
|
-
}
|
|
11444
|
-
this.radius = Math.sqrt(maxRadiusSq);
|
|
11445
11489
|
} else {
|
|
11446
|
-
var box =
|
|
11490
|
+
var box = Sphere.tempBox.setFromPoints(points);
|
|
11447
11491
|
box.getCenter(center);
|
|
11448
|
-
this.radius = box.getSize().length() / 2;
|
|
11449
11492
|
}
|
|
11493
|
+
var maxRadiusSq = 0;
|
|
11494
|
+
for(var i = 0; i < points.length; i++){
|
|
11495
|
+
maxRadiusSq = Math.max(maxRadiusSq, center.distanceSquared(points[i]));
|
|
11496
|
+
}
|
|
11497
|
+
this.radius = Math.sqrt(maxRadiusSq);
|
|
11450
11498
|
return this;
|
|
11451
11499
|
};
|
|
11452
11500
|
/**
|
|
@@ -11563,7 +11611,10 @@ Ray.tempVec3 = new Vector3();
|
|
|
11563
11611
|
* @param point - 扩展点
|
|
11564
11612
|
* @returns 扩展结果
|
|
11565
11613
|
*/ _proto.expandByPoint = function expandByPoint(point) {
|
|
11566
|
-
|
|
11614
|
+
if (this.isEmpty()) {
|
|
11615
|
+
return this.set(point, 0);
|
|
11616
|
+
}
|
|
11617
|
+
var vector = Sphere.tempVec0.subtractVectors(point, this.center);
|
|
11567
11618
|
var lengthSquared = vector.lengthSquared();
|
|
11568
11619
|
if (lengthSquared > this.radius * this.radius) {
|
|
11569
11620
|
var length = Math.sqrt(lengthSquared);
|
|
@@ -11581,30 +11632,42 @@ Ray.tempVec3 = new Vector3();
|
|
|
11581
11632
|
* @param sphere - 包围球
|
|
11582
11633
|
* @returns 求并结果
|
|
11583
11634
|
*/ _proto.union = function union(sphere) {
|
|
11584
|
-
|
|
11585
|
-
|
|
11586
|
-
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
|
|
11590
|
-
this.
|
|
11591
|
-
|
|
11635
|
+
if (sphere.isEmpty()) {
|
|
11636
|
+
return this;
|
|
11637
|
+
}
|
|
11638
|
+
if (this.isEmpty()) {
|
|
11639
|
+
return this.copyFrom(sphere);
|
|
11640
|
+
}
|
|
11641
|
+
if (this.center.equals(sphere.center)) {
|
|
11642
|
+
this.radius = Math.max(this.radius, sphere.radius);
|
|
11643
|
+
} else {
|
|
11644
|
+
var point = Sphere.tempVec0;
|
|
11645
|
+
var offset = Sphere.tempVec1.subtractVectors(sphere.center, this.center).setLength(sphere.radius);
|
|
11646
|
+
this.expandByPoint(point.copyFrom(sphere.center).add(offset));
|
|
11647
|
+
this.expandByPoint(point.copyFrom(sphere.center).subtract(offset));
|
|
11648
|
+
}
|
|
11592
11649
|
return this;
|
|
11593
11650
|
};
|
|
11594
11651
|
/**
|
|
11595
|
-
*
|
|
11652
|
+
* 获取两个包围球交集的保守包围球。部分重叠时,真实交集为透镜形,
|
|
11653
|
+
* 因此结果取两个输入中较小的包围球,并不精确表示交集。
|
|
11596
11654
|
* @param other - 其它包围球
|
|
11597
11655
|
* @returns 求交结果
|
|
11598
11656
|
*/ _proto.intersect = function intersect(other) {
|
|
11599
|
-
|
|
11600
|
-
var distance = vector.length();
|
|
11601
|
-
var radiusSum = this.radius + other.radius;
|
|
11602
|
-
if (distance > radiusSum) {
|
|
11657
|
+
if (this.isEmpty() || other.isEmpty()) {
|
|
11603
11658
|
return this.makeEmpty();
|
|
11604
11659
|
}
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
|
|
11660
|
+
var distance = this.center.distance(other.center);
|
|
11661
|
+
if (distance > this.radius + other.radius) {
|
|
11662
|
+
return this.makeEmpty();
|
|
11663
|
+
}
|
|
11664
|
+
if (this.radius >= distance + other.radius) {
|
|
11665
|
+
return this.copyFrom(other);
|
|
11666
|
+
}
|
|
11667
|
+
if (other.radius >= distance + this.radius) {
|
|
11668
|
+
return this;
|
|
11669
|
+
}
|
|
11670
|
+
return this.radius <= other.radius ? this : this.copyFrom(other);
|
|
11608
11671
|
};
|
|
11609
11672
|
/**
|
|
11610
11673
|
* 包围球判等
|
|
@@ -11621,6 +11684,9 @@ Ray.tempVec3 = new Vector3();
|
|
|
11621
11684
|
};
|
|
11622
11685
|
return Sphere;
|
|
11623
11686
|
}();
|
|
11687
|
+
Sphere$1.tempBox = new Box3();
|
|
11688
|
+
Sphere$1.tempVec0 = new Vector3();
|
|
11689
|
+
Sphere$1.tempVec1 = new Vector3();
|
|
11624
11690
|
|
|
11625
11691
|
var index = /*#__PURE__*/Object.freeze({
|
|
11626
11692
|
__proto__: null,
|
|
@@ -22824,7 +22890,7 @@ var canvasPool = new CanvasPool();
|
|
|
22824
22890
|
ctx.textBaseline = "alphabetic";
|
|
22825
22891
|
ctx.fillStyle = "#ffffff";
|
|
22826
22892
|
this.paddingPx = GLYPH_PADDING * resolution;
|
|
22827
|
-
this.italicScale = fontStyle === "italic" ? 2 : 1;
|
|
22893
|
+
this.italicScale = fontStyle === "italic" || fontStyle === "oblique" ? 2 : 1;
|
|
22828
22894
|
// ascent/descent 由探针 '|ÉqÅM' 测得 actualBoundingBox(重音字已抬高 ink 顶),
|
|
22829
22895
|
// 两者内部保持浮点,仅 cell 高做一次外层 ceil — 与 padding 共同保证 cell 内不裁切
|
|
22830
22896
|
var fontHeightPx = ascentPx + descentPx;
|
|
@@ -37784,7 +37850,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
37784
37850
|
return ret;
|
|
37785
37851
|
}
|
|
37786
37852
|
|
|
37787
|
-
var version$1 = "2.10.0
|
|
37853
|
+
var version$1 = "2.10.0";
|
|
37788
37854
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
37789
37855
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
37790
37856
|
var reverseParticle = false;
|
|
@@ -43013,7 +43079,7 @@ registerPlugin("text", TextLoader);
|
|
|
43013
43079
|
registerPlugin("sprite", SpriteLoader);
|
|
43014
43080
|
registerPlugin("particle", ParticleLoader);
|
|
43015
43081
|
registerPlugin("interact", InteractLoader);
|
|
43016
|
-
var version = "2.10.0
|
|
43082
|
+
var version = "2.10.0";
|
|
43017
43083
|
logger.info("Core version: " + version + ".");
|
|
43018
43084
|
|
|
43019
43085
|
export { ATLAS_SIZE, ActivationMixerPlayable, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AndNode, AndNodeData, Animatable, AnimationClip, AnimationClipNode, AnimationClipNodeData, AnimationEvent, AnimationGraphAsset, Animator, ApplyAdditiveNode, ApplyAdditiveNodeData, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BezierDataMap, BezierEasing, BezierLengthData, BezierMap, BezierPath, BezierQuat, BinaryAsset, BlendNode, BlendNodeData, BoolValueNode, BoundingBoxInfo, Buffer, BufferDataType, BufferUsage, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, Camera, CameraController, CameraVFXItemLoader, Circle$1 as Circle, ColorCurve, ColorPlayable, ColorPropertyMixerPlayable, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, ComponentTimePlayable, ComponentTimePlayableAsset, ComponentTimeTrack, Composition, CompositionComponent, CompressTextureCapabilityType, ConstBoolNode, ConstBoolNodeData, ConstFloatNode, ConstFloatNodeData, ConstraintTarget, ControlParameterBoolNode, ControlParameterBoolNodeData, ControlParameterFloatNode, ControlParameterFloatNodeData, ControlParameterTriggerNode, ControlParameterTriggerNodeData, DEFAULT_FONTS, DEFAULT_FPS, DataBuffer, Database, Deferred, DestroyOptions, Downloader, DrawObjectPass, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectComponentTimeTrack, EffectsObject, EffectsPackage, Ellipse, Engine, EqualNodeData, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatComparisonNode, FloatComparisonNodeData, FloatPropertyMixerPlayable, FloatPropertyPlayableAsset, FloatPropertyTrack, FloatValueNode, FrameComponent, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GlyphAtlas, GradientValue, GraphInstance, GraphNode, GraphNodeData, Graphics, GreaterNodeData, HELP_LINK, HitTestType, InputEvent, InputEventKey, InputEventMouse, InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch, InputEventWithModifiers, InteractComponent, InteractLoader, InteractMesh, InvalidIndex, Item, KeyLocation, LayerBlendNode, LayerBlendNodeData, LessNodeData, LineSegments, LinearValue, MaskMode, MaskProcessor, MaskableGraphic, Material, MaterialDataBlock, MaterialRenderType, MaterialState, MaterialTrack, Mesh, MouseButton, MouseButtonMask, NodeTransform, NotNode, NotNodeData, NotifyEvent, ObjectBindingTrack, OrNode, OrNodeData, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleMixerPlayable, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PlayState, Playable, PlayableAsset, PlayableOutput, Plugin, PluginSystem, PointerEventData, PointerEventType, PolyStar, Polygon, Pose, PoseNode, PositionConstraint, PostProcessVolume, Precomposition, PrecompositionManager, PropertyClipPlayable, PropertyTrack, REFERENCE_CURVE, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RaycastResult, Rectangle$1 as Rectangle, ReferenceCurve, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTargetPool, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SceneLoader, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, SourceType, Sprite, SpriteColorMixerPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteComponentTimeTrack, SpriteLoader, SpritePropertyMixerPlayable, SpritePropertyPlayableAsset, SpritePropertyTrack, SpriteRotation, StarType, StateMachineNode, StateMachineNodeData, StateNode, StateNodeData, StaticValue, SubCompositionClipPlayable, SubCompositionMixerPlayable, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TangentMode, TextCache, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TexturePaintScaleMode, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelineInstance, TrackAsset, TrackMixerPlayable, TrackType, Transform, TransformMixerPlayable, TransformPlayable, TransformPlayableAsset, TransformTrack, TransitionNode, TransitionNodeData, TransitionState, Triangle, TrimPath, TrimPathMode, UpdateModes, VFXItem, ValueGetter, ValueNode, Vector2Curve, Vector2PropertyMixerPlayable, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector3Curve, Vector3PropertyMixerPlayable, Vector3PropertyTrack, Vector3ropertyPlayableAsset, Vector4Curve, Vector4PropertyMixerPlayable, Vector4PropertyPlayableAsset, Vector4PropertyTrack, VertexBuffer, WeightedMode, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, breakOpportunityAfter, buildBezierData, buildEasingCurve, buildLine, calculateTranslation, canUseBOM, canvasPool, closePointEps, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createGLContext, createKeyFrameMeta, createShape, createTypedArray, createValueGetter, curveEps, decimalEqual, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, extractMinAndMax, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTexture, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateWhiteTexture, getBackgroundImage, getBytesPerElement, getClass, getColorFromGradientStops, getConfig, getControlPoints, getDataByteLength, getDataType, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getKeyFrameMetaByRawValue, getMergedStore, getNodeDataClass, getParticleMeshShader, getPixelRatio, getPluginUsageInfo, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isBreakChar, isCJKLike, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isOpenHarmony, isPlainObject, isPowerOfTwo, isSafeFontFamily, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, modifyMaxKeyframeShader, nearestPowerOfTwo, nodeDataClass, noop, normalizeColor, numberToFix, oldBezierKeyFramesToNew, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setRayFromCamera, setSideMode, sortByOrder, index$1 as spec, textureLoaderRegistry, thresholdFrag, throwDestroyedError, toBufferView, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|