three-base 1.0.81 → 1.0.82
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/lib/ApngTexture.js +107 -40
- package/lib/ApngTextureManage.js +100 -51
- package/lib/EventMesh.js +42 -22
- package/lib/ExtrudeMesh.js +178 -147
- package/lib/FPScontrol.js +133 -116
- package/lib/InstancedGroupMesh.js +45 -25
- package/lib/KeyFrameAnimation.js +54 -37
- package/lib/PlaneText.js +34 -14
- package/lib/PlaneWithHtml.js +126 -48
- package/lib/PointLight/PointLight.js +65 -45
- package/lib/Sky/Sky.js +30 -11
- package/lib/SpriteText2.js +166 -90
- package/lib/Text3D/Text3D.js +61 -40
- package/lib/Text3D/fontController.js +284 -149
- package/lib/ThreeBase.js +341 -204
- package/lib/ThreeMouse.js +203 -244
- package/lib/Transition.js +161 -95
- package/lib/keyContorls.js +102 -74
- package/lib/planeModal1/PlaneModal1.js +162 -90
- package/lib/shaders.js +36 -178
- package/lib/spriteModal1/SpriteModal1.js +165 -93
- package/lib/threeLoader.js +89 -66
- package/lib/threeUtils.js +84 -59
- package/package.json +1 -1
package/lib/SpriteText2.js
CHANGED
|
@@ -4,87 +4,160 @@
|
|
|
4
4
|
* @Last Modified by: xiaosihan
|
|
5
5
|
* @Last Modified time: 2023-04-24 16:18:47
|
|
6
6
|
*/
|
|
7
|
+
var __extends = (this && this.__extends) || (function () {
|
|
8
|
+
var extendStatics = function (d, b) {
|
|
9
|
+
extendStatics = Object.setPrototypeOf ||
|
|
10
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
11
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
12
|
+
return extendStatics(d, b);
|
|
13
|
+
};
|
|
14
|
+
return function (d, b) {
|
|
15
|
+
if (typeof b !== "function" && b !== null)
|
|
16
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
17
|
+
extendStatics(d, b);
|
|
18
|
+
function __() { this.constructor = d; }
|
|
19
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
20
|
+
};
|
|
21
|
+
})();
|
|
7
22
|
import { LinearFilter, Sprite, Texture } from 'three';
|
|
8
23
|
// 带箭头的精灵文字
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
var SpriteText2 = /** @class */ (function (_super) {
|
|
25
|
+
__extends(SpriteText2, _super);
|
|
26
|
+
function SpriteText2(text, textHeight, color) {
|
|
27
|
+
if (text === void 0) { text = ''; }
|
|
28
|
+
if (textHeight === void 0) { textHeight = 10; }
|
|
29
|
+
if (color === void 0) { color = 'rgba(255, 255, 255, 1)'; }
|
|
30
|
+
var _this = _super.call(this) || this;
|
|
31
|
+
_this._text = "";
|
|
32
|
+
_this._textHeight = 0;
|
|
33
|
+
_this._color = "#ffffff";
|
|
34
|
+
_this._backgroundColor = false; // no background color
|
|
35
|
+
_this._padding = 0;
|
|
36
|
+
_this._borderWidth = 0;
|
|
37
|
+
_this._borderRadius = 0;
|
|
38
|
+
_this._borderColor = 'white';
|
|
39
|
+
_this._strokeWidth = 0;
|
|
40
|
+
_this._strokeColor = 'white';
|
|
41
|
+
_this._fontFace = 'Arial';
|
|
42
|
+
_this._fontSize = 90; // defines text resolution
|
|
43
|
+
_this._fontWeight = 'normal';
|
|
44
|
+
_this._canvas = document.createElement('canvas');
|
|
45
|
+
_this._text = "".concat(text);
|
|
46
|
+
_this._textHeight = textHeight;
|
|
47
|
+
_this._color = color;
|
|
48
|
+
_this._backgroundColor = false; // no background color
|
|
49
|
+
_this._padding = 0;
|
|
50
|
+
_this._borderWidth = 0;
|
|
51
|
+
_this._borderRadius = 0;
|
|
52
|
+
_this._borderColor = 'white';
|
|
53
|
+
_this._strokeWidth = 0;
|
|
54
|
+
_this._strokeColor = 'white';
|
|
55
|
+
_this._fontFace = 'Arial';
|
|
56
|
+
_this._fontSize = 90; // defines text resolution
|
|
57
|
+
_this._fontWeight = 'normal';
|
|
58
|
+
_this._genCanvas();
|
|
59
|
+
return _this;
|
|
26
60
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
Object.defineProperty(SpriteText2.prototype, "text", {
|
|
62
|
+
get: function () { return this._text; },
|
|
63
|
+
set: function (text) { this._text = text; this._genCanvas(); },
|
|
64
|
+
enumerable: false,
|
|
65
|
+
configurable: true
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(SpriteText2.prototype, "textHeight", {
|
|
68
|
+
get: function () { return this._textHeight; },
|
|
69
|
+
set: function (textHeight) { this._textHeight = textHeight; this._genCanvas(); },
|
|
70
|
+
enumerable: false,
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(SpriteText2.prototype, "color", {
|
|
74
|
+
get: function () { return this._color; },
|
|
75
|
+
set: function (color) { this._color = color; this._genCanvas(); },
|
|
76
|
+
enumerable: false,
|
|
77
|
+
configurable: true
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(SpriteText2.prototype, "backgroundColor", {
|
|
80
|
+
get: function () { return this._backgroundColor; },
|
|
81
|
+
set: function (color) { this._backgroundColor = color; this._genCanvas(); },
|
|
82
|
+
enumerable: false,
|
|
83
|
+
configurable: true
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(SpriteText2.prototype, "padding", {
|
|
86
|
+
get: function () { return this._padding; },
|
|
87
|
+
set: function (padding) { this._padding = padding; this._genCanvas(); },
|
|
88
|
+
enumerable: false,
|
|
89
|
+
configurable: true
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(SpriteText2.prototype, "borderWidth", {
|
|
92
|
+
get: function () { return this._borderWidth; },
|
|
93
|
+
set: function (borderWidth) { this._borderWidth = borderWidth; this._genCanvas(); },
|
|
94
|
+
enumerable: false,
|
|
95
|
+
configurable: true
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(SpriteText2.prototype, "borderRadius", {
|
|
98
|
+
get: function () { return this._borderRadius; },
|
|
99
|
+
set: function (borderRadius) { this._borderRadius = borderRadius; this._genCanvas(); },
|
|
100
|
+
enumerable: false,
|
|
101
|
+
configurable: true
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(SpriteText2.prototype, "borderColor", {
|
|
104
|
+
get: function () { return this._borderColor; },
|
|
105
|
+
set: function (borderColor) { this._borderColor = borderColor; this._genCanvas(); },
|
|
106
|
+
enumerable: false,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(SpriteText2.prototype, "fontFace", {
|
|
110
|
+
get: function () { return this._fontFace; },
|
|
111
|
+
set: function (fontFace) { this._fontFace = fontFace; this._genCanvas(); },
|
|
112
|
+
enumerable: false,
|
|
113
|
+
configurable: true
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(SpriteText2.prototype, "fontSize", {
|
|
116
|
+
get: function () { return this._fontSize; },
|
|
117
|
+
set: function (fontSize) { this._fontSize = fontSize; this._genCanvas(); },
|
|
118
|
+
enumerable: false,
|
|
119
|
+
configurable: true
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(SpriteText2.prototype, "fontWeight", {
|
|
122
|
+
get: function () { return this._fontWeight; },
|
|
123
|
+
set: function (fontWeight) { this._fontWeight = fontWeight; this._genCanvas(); },
|
|
124
|
+
enumerable: false,
|
|
125
|
+
configurable: true
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(SpriteText2.prototype, "strokeWidth", {
|
|
128
|
+
get: function () { return this._strokeWidth; },
|
|
129
|
+
set: function (strokeWidth) { this._strokeWidth = strokeWidth; this._genCanvas(); },
|
|
130
|
+
enumerable: false,
|
|
131
|
+
configurable: true
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(SpriteText2.prototype, "strokeColor", {
|
|
134
|
+
get: function () { return this._strokeColor; },
|
|
135
|
+
set: function (strokeColor) { this._strokeColor = strokeColor; this._genCanvas(); },
|
|
136
|
+
enumerable: false,
|
|
137
|
+
configurable: true
|
|
138
|
+
});
|
|
139
|
+
SpriteText2.prototype._genCanvas = function () {
|
|
140
|
+
var _this = this;
|
|
141
|
+
var canvas = this._canvas;
|
|
142
|
+
var ctx = canvas.getContext('2d');
|
|
143
|
+
var border = Array.isArray(this.borderWidth) ? this.borderWidth : [this.borderWidth, this.borderWidth]; // x,y border
|
|
144
|
+
var relBorder = border.map(function (b) { return b * _this.fontSize * 0.1; }); // border in canvas units
|
|
145
|
+
var borderRadius = Array.isArray(this.borderRadius) ? this.borderRadius : [this.borderRadius, this.borderRadius, this.borderRadius, this.borderRadius]; // tl tr br bl corners
|
|
146
|
+
var relBorderRadius = borderRadius.map(function (b) { return b * _this.fontSize * 0.1; }); // border radius in canvas units
|
|
147
|
+
var padding = Array.isArray(this.padding) ? this.padding : [this.padding, this.padding]; // x,y padding
|
|
148
|
+
var relPadding = padding.map(function (p) { return p * _this.fontSize * 0.1; }); // padding in canvas units
|
|
149
|
+
var lines = this.text.split('\n');
|
|
150
|
+
var font = "".concat(this.fontWeight, " ").concat(this.fontSize, "px ").concat(this.fontFace);
|
|
78
151
|
ctx.font = font; // measure canvas with appropriate font
|
|
79
|
-
|
|
80
|
-
|
|
152
|
+
var innerWidth = Math.max.apply(Math, lines.map(function (line) { return ctx.measureText(line).width; }));
|
|
153
|
+
var innerHeight = this.fontSize * lines.length;
|
|
81
154
|
canvas.width = innerWidth + relBorder[0] * 2 + relPadding[0] * 2;
|
|
82
155
|
canvas.height = (innerHeight + relBorder[1] * 2 + relPadding[1] * 2) * 2 + 40;
|
|
83
156
|
// paint border
|
|
84
157
|
if (this.borderWidth) {
|
|
85
158
|
ctx.strokeStyle = this.borderColor;
|
|
86
159
|
if (relBorder[0]) { // left + right borders
|
|
87
|
-
|
|
160
|
+
var hb = relBorder[0] / 2;
|
|
88
161
|
ctx.lineWidth = relBorder[0];
|
|
89
162
|
ctx.beginPath();
|
|
90
163
|
ctx.moveTo(hb, relBorderRadius[0]);
|
|
@@ -94,7 +167,7 @@ export default class SpriteText2 extends Sprite {
|
|
|
94
167
|
ctx.stroke();
|
|
95
168
|
}
|
|
96
169
|
if (relBorder[1]) { // top + bottom borders
|
|
97
|
-
|
|
170
|
+
var hb = relBorder[1] / 2;
|
|
98
171
|
ctx.lineWidth = relBorder[1];
|
|
99
172
|
ctx.beginPath();
|
|
100
173
|
ctx.moveTo(Math.max(relBorder[0], relBorderRadius[0]), hb);
|
|
@@ -107,8 +180,8 @@ export default class SpriteText2 extends Sprite {
|
|
|
107
180
|
ctx.stroke();
|
|
108
181
|
}
|
|
109
182
|
if (this.borderRadius) { // strike rounded corners
|
|
110
|
-
|
|
111
|
-
|
|
183
|
+
var cornerWidth = Math.max.apply(Math, relBorder);
|
|
184
|
+
var hb = cornerWidth / 2;
|
|
112
185
|
ctx.lineWidth = cornerWidth;
|
|
113
186
|
ctx.beginPath();
|
|
114
187
|
[
|
|
@@ -116,7 +189,8 @@ export default class SpriteText2 extends Sprite {
|
|
|
116
189
|
!!relBorderRadius[1] && [canvas.width - relBorderRadius[1], canvas.width - hb, hb, relBorderRadius[1]],
|
|
117
190
|
!!relBorderRadius[2] && [canvas.width - relBorderRadius[2], canvas.width - hb, ((canvas.height - 40) / 2) - hb, ((canvas.height - 40) / 2) - relBorderRadius[2]],
|
|
118
191
|
!!relBorderRadius[3] && [relBorderRadius[3], hb, ((canvas.height - 40) / 2) - hb, ((canvas.height - 40) / 2) - relBorderRadius[3]]
|
|
119
|
-
].filter(d
|
|
192
|
+
].filter(function (d) { return d; }).forEach(function (_a) {
|
|
193
|
+
var x0 = _a[0], x1 = _a[1], y0 = _a[2], y1 = _a[3];
|
|
120
194
|
ctx.moveTo(x0, y0);
|
|
121
195
|
ctx.quadraticCurveTo(x1, y0, x1, y1);
|
|
122
196
|
});
|
|
@@ -152,36 +226,36 @@ export default class SpriteText2 extends Sprite {
|
|
|
152
226
|
ctx.font = font; // Set font again after canvas is resized, as context properties are reset
|
|
153
227
|
ctx.fillStyle = this.color;
|
|
154
228
|
ctx.textBaseline = 'bottom';
|
|
155
|
-
|
|
229
|
+
var drawTextStroke = this.strokeWidth > 0;
|
|
156
230
|
if (drawTextStroke) {
|
|
157
231
|
ctx.lineWidth = this.strokeWidth * this.fontSize / 10;
|
|
158
232
|
ctx.strokeStyle = this.strokeColor;
|
|
159
233
|
}
|
|
160
|
-
lines.forEach((line, index)
|
|
161
|
-
|
|
162
|
-
|
|
234
|
+
lines.forEach(function (line, index) {
|
|
235
|
+
var lineX = (innerWidth - ctx.measureText(line).width) / 2;
|
|
236
|
+
var lineY = (index + 1) * _this.fontSize;
|
|
163
237
|
drawTextStroke && ctx.strokeText(line, lineX, lineY);
|
|
164
238
|
ctx.fillText(line, lineX, lineY);
|
|
165
239
|
});
|
|
166
240
|
// Inject canvas into sprite
|
|
167
241
|
if (this.material.map)
|
|
168
242
|
this.material.map.dispose(); // gc previous texture
|
|
169
|
-
|
|
243
|
+
var texture = this.material.map = new Texture(canvas);
|
|
170
244
|
texture.minFilter = LinearFilter;
|
|
171
245
|
texture.needsUpdate = true;
|
|
172
|
-
|
|
246
|
+
var yScale = this.textHeight * lines.length + border[1] * 2 + padding[1] * 2;
|
|
173
247
|
this.scale.set(yScale * canvas.width / canvas.height, yScale, 0);
|
|
174
|
-
}
|
|
248
|
+
};
|
|
175
249
|
//鼠标拾取计算
|
|
176
|
-
raycast(raycaster, intersects) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
250
|
+
SpriteText2.prototype.raycast = function (raycaster, intersects) {
|
|
251
|
+
var intersect = [];
|
|
252
|
+
_super.prototype.raycast.call(this, raycaster, intersect);
|
|
253
|
+
var inte = intersect[0];
|
|
180
254
|
if (inte && (inte.uv.y > 0.55)) {
|
|
181
255
|
intersects.push(inte);
|
|
182
256
|
}
|
|
183
|
-
}
|
|
184
|
-
copy(source) {
|
|
257
|
+
};
|
|
258
|
+
SpriteText2.prototype.copy = function (source) {
|
|
185
259
|
this.color = source.color;
|
|
186
260
|
this.backgroundColor = source.backgroundColor;
|
|
187
261
|
this.padding = source.padding;
|
|
@@ -193,5 +267,7 @@ export default class SpriteText2 extends Sprite {
|
|
|
193
267
|
this.strokeWidth = source.strokeWidth;
|
|
194
268
|
this.strokeColor = source.strokeColor;
|
|
195
269
|
return this;
|
|
196
|
-
}
|
|
197
|
-
|
|
270
|
+
};
|
|
271
|
+
return SpriteText2;
|
|
272
|
+
}(Sprite));
|
|
273
|
+
export default SpriteText2;
|
package/lib/Text3D/Text3D.js
CHANGED
|
@@ -4,59 +4,80 @@
|
|
|
4
4
|
* @Last Modified by: xiaosihan
|
|
5
5
|
* @Last Modified time: 2023-04-07 21:52:03
|
|
6
6
|
*/
|
|
7
|
+
var __extends = (this && this.__extends) || (function () {
|
|
8
|
+
var extendStatics = function (d, b) {
|
|
9
|
+
extendStatics = Object.setPrototypeOf ||
|
|
10
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
11
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
12
|
+
return extendStatics(d, b);
|
|
13
|
+
};
|
|
14
|
+
return function (d, b) {
|
|
15
|
+
if (typeof b !== "function" && b !== null)
|
|
16
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
17
|
+
extendStatics(d, b);
|
|
18
|
+
function __() { this.constructor = d; }
|
|
19
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
20
|
+
};
|
|
21
|
+
})();
|
|
7
22
|
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js';
|
|
8
23
|
import { Mesh, MeshStandardMaterial } from "three";
|
|
9
24
|
import fontContorller from "./fontController";
|
|
10
25
|
// 3D文字模型
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
var Text3D = /** @class */ (function (_super) {
|
|
27
|
+
__extends(Text3D, _super);
|
|
28
|
+
function Text3D(text) {
|
|
29
|
+
if (text === void 0) { text = "new Text3D()"; }
|
|
30
|
+
var _this = _super.call(this) || this;
|
|
31
|
+
_this.material = new MeshStandardMaterial({
|
|
32
|
+
metalness: 0.8,
|
|
33
|
+
roughness: 0.5, // 粗糙度,值为0到1
|
|
34
|
+
});
|
|
35
|
+
// 配置
|
|
36
|
+
_this._config = {
|
|
37
|
+
text: "",
|
|
38
|
+
fontType: "simhei",
|
|
39
|
+
size: 1,
|
|
40
|
+
curveSegments: 10,
|
|
41
|
+
height: 0.1,
|
|
42
|
+
bevelEnabled: true,
|
|
43
|
+
bevelThickness: 0.02,
|
|
44
|
+
bevelSize: 0.015,
|
|
45
|
+
bevelOffset: 0,
|
|
46
|
+
bevelSegments: 3, //斜角分段
|
|
47
|
+
};
|
|
48
|
+
_this.setText({ text: text });
|
|
49
|
+
return _this;
|
|
15
50
|
}
|
|
16
|
-
// 字体的存储路径 例如 : "http://drm.gitee.io/three-base-font/simhei/字.js"
|
|
17
|
-
static path = "http://drm.gitee.io/three-base-font/";
|
|
18
|
-
material = new MeshStandardMaterial({
|
|
19
|
-
metalness: 0.8,
|
|
20
|
-
roughness: 0.5, // 粗糙度,值为0到1
|
|
21
|
-
});
|
|
22
|
-
// 配置
|
|
23
|
-
_config = {
|
|
24
|
-
text: "",
|
|
25
|
-
fontType: "simhei",
|
|
26
|
-
size: 1,
|
|
27
|
-
curveSegments: 10,
|
|
28
|
-
height: 0.1,
|
|
29
|
-
bevelEnabled: true,
|
|
30
|
-
bevelThickness: 0.02,
|
|
31
|
-
bevelSize: 0.015,
|
|
32
|
-
bevelOffset: 0,
|
|
33
|
-
bevelSegments: 3, //斜角分段
|
|
34
|
-
};
|
|
35
51
|
// 设置文字
|
|
36
|
-
setText(text3DProps) {
|
|
37
|
-
|
|
52
|
+
Text3D.prototype.setText = function (text3DProps) {
|
|
53
|
+
var _this = this;
|
|
54
|
+
if (Object.keys(text3DProps).some(function (key) { return text3DProps[key] !== _this._config[key]; })) {
|
|
38
55
|
Object.assign(this._config, text3DProps);
|
|
39
56
|
fontContorller.loadText({
|
|
40
57
|
fontBasePath: Text3D.path,
|
|
41
58
|
text: this._config.text,
|
|
42
59
|
fontType: this._config.fontType,
|
|
43
|
-
callback: THREEFont
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
callback: function (THREEFont) {
|
|
61
|
+
_this.geometry.dispose();
|
|
62
|
+
_this.geometry = new TextGeometry(_this._config.text || "", {
|
|
46
63
|
font: THREEFont,
|
|
47
|
-
size:
|
|
48
|
-
curveSegments:
|
|
49
|
-
height:
|
|
50
|
-
bevelEnabled:
|
|
51
|
-
bevelThickness:
|
|
52
|
-
bevelSize:
|
|
53
|
-
bevelOffset:
|
|
54
|
-
bevelSegments:
|
|
64
|
+
size: _this._config.size,
|
|
65
|
+
curveSegments: _this._config.curveSegments,
|
|
66
|
+
height: _this._config.height,
|
|
67
|
+
bevelEnabled: _this._config.bevelEnabled,
|
|
68
|
+
bevelThickness: _this._config.bevelThickness,
|
|
69
|
+
bevelSize: _this._config.bevelSize,
|
|
70
|
+
bevelOffset: _this._config.bevelOffset,
|
|
71
|
+
bevelSegments: _this._config.bevelSegments, //斜角分段
|
|
55
72
|
});
|
|
56
|
-
|
|
57
|
-
|
|
73
|
+
_this.geometry.center();
|
|
74
|
+
_this.dispatchEvent({ type: "loaded" });
|
|
58
75
|
}
|
|
59
76
|
});
|
|
60
77
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
78
|
+
};
|
|
79
|
+
// 字体的存储路径 例如 : "http://drm.gitee.io/three-base-font/simhei/字.js"
|
|
80
|
+
Text3D.path = "http://drm.gitee.io/three-base-font/";
|
|
81
|
+
return Text3D;
|
|
82
|
+
}(Mesh));
|
|
83
|
+
export default Text3D;
|