JavaScriptから操作できるthree.jsのobject等はwindow.PALANAR
に全て格納されており、これらの値にアクセスできます。
window.PALANAR
DeviceOrientationControls: null arAssets: [e] (1) arAudios: [t] (1) arContentType: "eighth_wall_world_tracking" arEffects: [] (0) arLights: [t, t, t] (3) bgm: undefined captureCanvas: <canvas> captureCanvasContext: CanvasRenderingContext2D {canvas: <canvas>, webkitBackingStorePixelRatio: 1, webkitImageSmoothingEnabled: true, webkitLineDash: [], webkitLineDashOffset: 0, …} captureStream: 30 captureVideoBitsPerSecond: 25000000 deviceCameraMode: "environment" fingerEventHandler: t {screenDom: <div id="three-stage">, state: Object, eventCallbacks: Array, twoFingersDistnceCaches: []} groundPlane: t {object3D: Ra, groundMesh: Cs, shadowPlane: Cs, hierPlane: null, raycaster: Object, …} object3DDragger8thWall: t {intersectPlane: Cs, stageDom: <div id="three-stage">, object3Ds: [], currentDragTarget: null, raycaster: Object, …} pinchInOutHandler: t {stageDom: <div id="three-stage">, object3Ds: [], currentPinchTarget: null, raycaster: Object, camera: Ds, …} screenFixedWorld: t {scene: t, camera: t, renderer: ce, orbitControls: null, deviceOrientationControls: null, …} threeWorld: t {scene: t, camera: Object, renderer: ce, orbitControls: null, deviceOrientationControls: null, …} twoFingersRotateHandler: t {stageDom: <div id="three-stage">, object3Ds: [], currentRotateTarget: null, raycaster: Object, camera: Ds, …}
例
window.PALANAR.addEventListener("loadedAllContents", () => {
// window.PALANAR.threeWorld.scene.scene.childrenを取得
console.log(window.PALANAR.threeWorld.scene.scene.children);
});
window.PALANAR.threeWorld.scene.scene.children
で、sceneに追加されているobjectを取得します。
返ってくる値のサンプル
Ds {isObject3D: true, id: 5, uuid: "ff0a1a40-d128-4642-84f6-9e812caf84ad", name: "", type: "PerspectiveCamera", …} 1 Ra {isObject3D: true, id: 20, uuid: "53807897-b52f-4139-b593-dfe396a3355c", name: "", type: "Group", …} 2 Ac {isObject3D: true, id: 24, uuid: "c80d0a9f-16ac-4517-ba92-adad43f2f281", name: "", type: "DirectionalLight", …} 3 Ra {isObject3D: true, id: 31, uuid: "bbb4ecf4-436c-42fa-be43-e73394eded74", name: "Scene", type: "Group", …} 4 {isObject3D: true, id: 75, uuid: "9d91d13a-30b8-49e5-8341-027c8d71599a", name: "", type: "BoxHelper", …} 5 Ec {isObject3D: true, id: 27, uuid: "fe6549a4-7cf5-4756-b6f7-5db2c796391a", name: "", type: "AmbientLight", …} 6 Ac {isObject3D: true, id: 28, uuid: "3ce14357-d2d5-4b60-881a-ef6721e75490", name: "", type: "DirectionalLight", …}
コメント
0件のコメント
記事コメントは受け付けていません。