lythreeframe 1.1.16 → 1.1.18
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/bundle.cjs.js +12 -6
- package/dist/bundle.esm.js +12 -6
- package/dist/lythreeframe/Frame/World.d.ts +2 -1
- package/package.json +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -1251,7 +1251,7 @@ const DefaultPostProcessParam = {
|
|
|
1251
1251
|
class World {
|
|
1252
1252
|
get scene() {
|
|
1253
1253
|
var _a;
|
|
1254
|
-
let scene = (_a = this.
|
|
1254
|
+
let scene = (_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.scene;
|
|
1255
1255
|
if (!scene) {
|
|
1256
1256
|
throw new Error("scene is null");
|
|
1257
1257
|
}
|
|
@@ -1263,15 +1263,21 @@ class World {
|
|
|
1263
1263
|
get controller() {
|
|
1264
1264
|
return this.app.controller;
|
|
1265
1265
|
}
|
|
1266
|
+
get rootActor() {
|
|
1267
|
+
if (!this._rootActor) {
|
|
1268
|
+
throw new Error("rootActor is null");
|
|
1269
|
+
}
|
|
1270
|
+
return this._rootActor;
|
|
1271
|
+
}
|
|
1266
1272
|
constructor(app, worldParam) {
|
|
1267
|
-
this.
|
|
1273
|
+
this._rootActor = null;
|
|
1268
1274
|
this.actors = new Set();
|
|
1269
1275
|
this.tickableActors = new Set();
|
|
1270
1276
|
this.app = app;
|
|
1271
1277
|
this.worldParam = worldParam;
|
|
1272
1278
|
}
|
|
1273
1279
|
init() {
|
|
1274
|
-
this.
|
|
1280
|
+
this._rootActor = new this.worldParam.levelActorClass(this.app);
|
|
1275
1281
|
}
|
|
1276
1282
|
addTickableActor(actor) {
|
|
1277
1283
|
this.tickableActors.add(actor);
|
|
@@ -1291,8 +1297,8 @@ class World {
|
|
|
1291
1297
|
elem.destroy();
|
|
1292
1298
|
});
|
|
1293
1299
|
this.actors.clear();
|
|
1294
|
-
(_a = this.
|
|
1295
|
-
this.
|
|
1300
|
+
(_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1301
|
+
this._rootActor = null;
|
|
1296
1302
|
}
|
|
1297
1303
|
addActor(actor) {
|
|
1298
1304
|
var _a;
|
|
@@ -1300,7 +1306,7 @@ class World {
|
|
|
1300
1306
|
throw new Error("actor.threeObject is null");
|
|
1301
1307
|
}
|
|
1302
1308
|
actor.removeFromParent();
|
|
1303
|
-
(_a = this.
|
|
1309
|
+
(_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.addChildActor(actor, exports.AttachmentRules.KeepRelative);
|
|
1304
1310
|
this.actors.add(actor);
|
|
1305
1311
|
actor.onAddedToWorld(this);
|
|
1306
1312
|
this.viewport.markRenderStateDirty();
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1249,7 +1249,7 @@ const DefaultPostProcessParam = {
|
|
|
1249
1249
|
class World {
|
|
1250
1250
|
get scene() {
|
|
1251
1251
|
var _a;
|
|
1252
|
-
let scene = (_a = this.
|
|
1252
|
+
let scene = (_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.scene;
|
|
1253
1253
|
if (!scene) {
|
|
1254
1254
|
throw new Error("scene is null");
|
|
1255
1255
|
}
|
|
@@ -1261,15 +1261,21 @@ class World {
|
|
|
1261
1261
|
get controller() {
|
|
1262
1262
|
return this.app.controller;
|
|
1263
1263
|
}
|
|
1264
|
+
get rootActor() {
|
|
1265
|
+
if (!this._rootActor) {
|
|
1266
|
+
throw new Error("rootActor is null");
|
|
1267
|
+
}
|
|
1268
|
+
return this._rootActor;
|
|
1269
|
+
}
|
|
1264
1270
|
constructor(app, worldParam) {
|
|
1265
|
-
this.
|
|
1271
|
+
this._rootActor = null;
|
|
1266
1272
|
this.actors = new Set();
|
|
1267
1273
|
this.tickableActors = new Set();
|
|
1268
1274
|
this.app = app;
|
|
1269
1275
|
this.worldParam = worldParam;
|
|
1270
1276
|
}
|
|
1271
1277
|
init() {
|
|
1272
|
-
this.
|
|
1278
|
+
this._rootActor = new this.worldParam.levelActorClass(this.app);
|
|
1273
1279
|
}
|
|
1274
1280
|
addTickableActor(actor) {
|
|
1275
1281
|
this.tickableActors.add(actor);
|
|
@@ -1289,8 +1295,8 @@ class World {
|
|
|
1289
1295
|
elem.destroy();
|
|
1290
1296
|
});
|
|
1291
1297
|
this.actors.clear();
|
|
1292
|
-
(_a = this.
|
|
1293
|
-
this.
|
|
1298
|
+
(_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1299
|
+
this._rootActor = null;
|
|
1294
1300
|
}
|
|
1295
1301
|
addActor(actor) {
|
|
1296
1302
|
var _a;
|
|
@@ -1298,7 +1304,7 @@ class World {
|
|
|
1298
1304
|
throw new Error("actor.threeObject is null");
|
|
1299
1305
|
}
|
|
1300
1306
|
actor.removeFromParent();
|
|
1301
|
-
(_a = this.
|
|
1307
|
+
(_a = this._rootActor) === null || _a === void 0 ? void 0 : _a.addChildActor(actor, AttachmentRules.KeepRelative);
|
|
1302
1308
|
this.actors.add(actor);
|
|
1303
1309
|
actor.onAddedToWorld(this);
|
|
1304
1310
|
this.viewport.markRenderStateDirty();
|
|
@@ -9,7 +9,8 @@ export declare class World {
|
|
|
9
9
|
get scene(): Scene;
|
|
10
10
|
get viewport(): Viewport;
|
|
11
11
|
get controller(): Controller;
|
|
12
|
-
|
|
12
|
+
get rootActor(): LevelActor;
|
|
13
|
+
protected _rootActor: LevelActor | null;
|
|
13
14
|
protected app: ThreeJsApp;
|
|
14
15
|
protected actors: Set<Actor>;
|
|
15
16
|
protected tickableActors: Set<Actor>;
|