@galacean/effects-threejs 2.0.0-alpha.21 → 2.0.0-alpha.22
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.d.ts +1 -0
- package/dist/index.js +70 -12
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +71 -13
- package/dist/index.mjs.map +1 -1
- package/dist/three-text-component.d.ts +19 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.22
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -4346,11 +4346,19 @@ var DataType;
|
|
|
4346
4346
|
DataType["Texture"] = "Texture";
|
|
4347
4347
|
DataType["AnimationClip"] = "AnimationClip";
|
|
4348
4348
|
DataType["TextComponent"] = "TextComponent";
|
|
4349
|
+
DataType["BinaryAsset"] = "BinaryAsset";
|
|
4350
|
+
// Timeline
|
|
4349
4351
|
DataType["TrackAsset"] = "TrackAsset";
|
|
4350
4352
|
DataType["TimelineAsset"] = "TimelineAsset";
|
|
4353
|
+
DataType["ObjectBindingTrack"] = "ObjectBindingTrack";
|
|
4354
|
+
DataType["TransformTrack"] = "TransformTrack";
|
|
4355
|
+
DataType["SpriteColorTrack"] = "SpriteColorTrack";
|
|
4356
|
+
DataType["ActivationTrack"] = "ActivationTrack";
|
|
4357
|
+
DataType["SubCompositionTrack"] = "SubCompositionTrack";
|
|
4351
4358
|
DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
|
|
4352
4359
|
DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
|
|
4353
|
-
DataType["
|
|
4360
|
+
DataType["ActivationPlayableAsset"] = "ActivationPlayableAsset";
|
|
4361
|
+
DataType["SubCompositionPlayableAsset"] = "SubCompositionPlayableAsset";
|
|
4354
4362
|
// FIXME: 先完成ECS的场景转换,后面移到spec中
|
|
4355
4363
|
DataType["MeshComponent"] = "MeshComponent";
|
|
4356
4364
|
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
@@ -24057,9 +24065,7 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24057
24065
|
function Camera(name, options) {
|
|
24058
24066
|
if (options === void 0) options = {};
|
|
24059
24067
|
this.name = name;
|
|
24060
|
-
this
|
|
24061
|
-
* 编辑器用于缩放画布
|
|
24062
|
-
*/ fovScaleRatio = 1.0;
|
|
24068
|
+
this.fovScaleRatio = 1.0;
|
|
24063
24069
|
this.viewMatrix = Matrix4.fromIdentity();
|
|
24064
24070
|
this.projectionMatrix = Matrix4.fromIdentity();
|
|
24065
24071
|
this.viewProjectionMatrix = Matrix4.fromIdentity();
|
|
@@ -24087,6 +24093,13 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
24087
24093
|
this.updateMatrix();
|
|
24088
24094
|
}
|
|
24089
24095
|
var _proto = Camera.prototype;
|
|
24096
|
+
_proto.setFovScaleRatio = function setFovScaleRatio(value) {
|
|
24097
|
+
this.fovScaleRatio = value;
|
|
24098
|
+
this.dirty = true;
|
|
24099
|
+
};
|
|
24100
|
+
_proto.getFovScaleRatio = function getFovScaleRatio() {
|
|
24101
|
+
return this.fovScaleRatio;
|
|
24102
|
+
};
|
|
24090
24103
|
/**
|
|
24091
24104
|
* 获取相机的视图变换矩阵
|
|
24092
24105
|
* @return
|
|
@@ -25324,10 +25337,10 @@ var listOrder = 0;
|
|
|
25324
25337
|
{
|
|
25325
25338
|
key: "editorScaleRatio",
|
|
25326
25339
|
get: function get() {
|
|
25327
|
-
return this.camera.
|
|
25340
|
+
return this.camera.getFovScaleRatio();
|
|
25328
25341
|
},
|
|
25329
25342
|
set: function set(value) {
|
|
25330
|
-
this.camera.
|
|
25343
|
+
this.camera.setFovScaleRatio(value);
|
|
25331
25344
|
}
|
|
25332
25345
|
}
|
|
25333
25346
|
]);
|
|
@@ -25726,7 +25739,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
|
|
|
25726
25739
|
registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
|
|
25727
25740
|
registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
|
|
25728
25741
|
registerPlugin("interact", InteractLoader, exports.VFXItem, true);
|
|
25729
|
-
var version$1 = "2.0.0-alpha.
|
|
25742
|
+
var version$1 = "2.0.0-alpha.22";
|
|
25730
25743
|
logger.info("Core version: " + version$1 + ".");
|
|
25731
25744
|
|
|
25732
25745
|
var _obj;
|
|
@@ -26770,11 +26783,10 @@ var seed = 1;
|
|
|
26770
26783
|
}
|
|
26771
26784
|
}
|
|
26772
26785
|
// @ts-expect-error
|
|
26773
|
-
return _extends({
|
|
26786
|
+
return _extends({}, options, {
|
|
26774
26787
|
target: target,
|
|
26775
26788
|
format: THREE__namespace.RGBAFormat,
|
|
26776
|
-
type: THREE__namespace.UnsignedByteType
|
|
26777
|
-
}, options, {
|
|
26789
|
+
type: THREE__namespace.UnsignedByteType,
|
|
26778
26790
|
minFilter: ThreeTexture.toThreeJsTextureFilter(options.minFilter),
|
|
26779
26791
|
magFilter: ThreeTexture.toThreeJsTextureFilter(options.magFilter),
|
|
26780
26792
|
wrapS: ThreeTexture.toThreeJsTextureWrap(options.wrapS),
|
|
@@ -27272,6 +27284,52 @@ exports.ThreeSpriteComponent = __decorate([
|
|
|
27272
27284
|
effectsClass(DataType.SpriteComponent)
|
|
27273
27285
|
], exports.ThreeSpriteComponent);
|
|
27274
27286
|
|
|
27287
|
+
exports.ThreeTextComponent = /*#__PURE__*/ function(ThreeSpriteComponent) {
|
|
27288
|
+
_inherits(ThreeTextComponent, ThreeSpriteComponent);
|
|
27289
|
+
function ThreeTextComponent(engine, props) {
|
|
27290
|
+
var _this;
|
|
27291
|
+
_this = ThreeSpriteComponent.call(this, engine, props) || this;
|
|
27292
|
+
_this.isDirty = true;
|
|
27293
|
+
_this.canvas = canvasPool.getCanvas();
|
|
27294
|
+
canvasPool.saveCanvas(_this.canvas);
|
|
27295
|
+
_this.context = _this.canvas.getContext("2d", {
|
|
27296
|
+
willReadFrequently: true
|
|
27297
|
+
});
|
|
27298
|
+
if (!props) {
|
|
27299
|
+
return _possible_constructor_return(_this);
|
|
27300
|
+
}
|
|
27301
|
+
var options = props.options;
|
|
27302
|
+
_this.updateWithOptions(options);
|
|
27303
|
+
_this.updateTexture(false);
|
|
27304
|
+
return _this;
|
|
27305
|
+
}
|
|
27306
|
+
var _proto = ThreeTextComponent.prototype;
|
|
27307
|
+
_proto.update = function update(dt) {
|
|
27308
|
+
ThreeSpriteComponent.prototype.update.call(this, dt);
|
|
27309
|
+
this.updateTexture(false);
|
|
27310
|
+
};
|
|
27311
|
+
_proto.fromData = function fromData(data) {
|
|
27312
|
+
ThreeSpriteComponent.prototype.fromData.call(this, data);
|
|
27313
|
+
var options = data.options;
|
|
27314
|
+
this.updateWithOptions(options);
|
|
27315
|
+
// Text
|
|
27316
|
+
this.updateTexture(false);
|
|
27317
|
+
};
|
|
27318
|
+
_proto.updateWithOptions = function updateWithOptions(options) {
|
|
27319
|
+
// OVERRIDE by mixins
|
|
27320
|
+
};
|
|
27321
|
+
_proto.updateTexture = function updateTexture(flipY) {
|
|
27322
|
+
// OVERRIDE by mixins
|
|
27323
|
+
};
|
|
27324
|
+
return ThreeTextComponent;
|
|
27325
|
+
}(exports.ThreeSpriteComponent);
|
|
27326
|
+
exports.ThreeTextComponent = __decorate([
|
|
27327
|
+
effectsClass(DataType.TextComponent)
|
|
27328
|
+
], exports.ThreeTextComponent);
|
|
27329
|
+
applyMixins(exports.ThreeTextComponent, [
|
|
27330
|
+
TextComponentBase
|
|
27331
|
+
]);
|
|
27332
|
+
|
|
27275
27333
|
setMaxSpriteMeshItemCount(8);
|
|
27276
27334
|
/**
|
|
27277
27335
|
* 图片的创建方法
|
|
@@ -27314,7 +27372,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
27314
27372
|
*/ Mesh.create = function(engine, props) {
|
|
27315
27373
|
return new ThreeMesh(engine, props);
|
|
27316
27374
|
};
|
|
27317
|
-
var version = "2.0.0-alpha.
|
|
27375
|
+
var version = "2.0.0-alpha.22";
|
|
27318
27376
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
27319
27377
|
|
|
27320
27378
|
exports.AbstractPlugin = AbstractPlugin;
|