MCPcopy Create free account
hub / github.com/Orillusion/orillusion / test

Method test

samples/base/Sample_AddRemove.ts:64–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 }
63
64 private async test() {
65 let list: Object3D[] = [];
66 let player = await Engine3D.res.loadGltf('gltfs/anim/Minion_Lane_Super_Dawn/Minion_Lane_Super_Dawn.glb');
67 // gui
68 GUIHelp.init();
69 GUIHelp.addButton("add", async () => {
70 /******** player1 *******/
71 let clone = player.clone()
72 clone.transform.x = Math.random() * 100 - 50;
73 clone.transform.y = Math.random() * 100 - 50;
74 clone.transform.z = Math.random() * 100 - 50;
75 clone.transform.scaleX = 20;
76 clone.transform.scaleY = 20;
77 clone.transform.scaleZ = 20;
78
79 this.view.scene.addChild(clone);
80 list.push(clone);
81 });
82
83 GUIHelp.addButton("remove", () => {
84 let index = Math.floor(list.length * Math.random());
85 let obj = list[index];
86 if (obj) {
87 list.splice(index, 1)
88 this.view.scene.removeChild(obj)
89 obj.destroy(true);
90 }
91 });
92
93 GUIHelp.open();
94 }
95}
96
97new Sample_AddRemove().run();

Callers 12

runMethod · 0.95
dirFunction · 0.80
autoIndexFunction · 0.80
opentype.jsFile · 0.80
isArabicCharFunction · 0.80
isIsolatedArabicCharFunction · 0.80
isTashkeelArabicCharFunction · 0.80
isLatinCharFunction · 0.80
isWhiteSpaceFunction · 0.80
dat.gui.module.jsFile · 0.80
endFunction · 0.80
setHexMethod · 0.80

Calls 10

loadGltfMethod · 0.80
addButtonMethod · 0.80
openMethod · 0.80
initMethod · 0.65
cloneMethod · 0.65
destroyMethod · 0.65
randomMethod · 0.45
addChildMethod · 0.45
pushMethod · 0.45
removeChildMethod · 0.45

Tested by

no test coverage detected