{“ast”:null,“code”:“function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }nnfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }nnfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }nnimport * as THREE from 'three'; // use of "test" strings signals this is unfinishednnvar Fountain =n/*#__PURE__*/nfunction () {n function Fountain(fountainContext) {n _classCallCheck(this, Fountain);nn this.fountainContext = fountainContext;n }nn _createClass(Fountain, [{n key: "aroundFountain",n value: function aroundFountain(fn) {n this.fountainContext.aroundFountain(this, function () {n fn.call(); // a "fountainGetter()" call in this .call, should always return this fountain, how?n // consider a multi threaded environment, and two contexts a and b executee fountainGetter at the same time. How would the logic at [1] know, which fountain to return?n // maybe the fountains for aroundFountain calls could be stored by thread id? or call scope id (i.e. stack frame id)?n });n }n }]);nn return Fountain;n}();nnvar FountainContext =n/*#__PURE__*/nfunction () {n function FountainContext() {n _classCallCheck(this, FountainContext);nn this.fountains = {};n this.fountainsForThreadId = {};n }nn _createClass(FountainContext, [{n key: "fountainGetter",n value: function fountainGetter() {n var identifier = arguments.length > 0 && arguments !== undefined ? arguments : undefined;nn if (identifier !== undefined) {n this.fountains = new Fountain(this);n return this.fountains;n } else {n console.warn(this.caller);n return this.fountainsForThreadId;n }n }n }, {n key: "aroundFountain",n value: function aroundFountain(fountain, fn) {n this.fountainsForThreadId = fountain;n fn.call();n delete this.fountainsForThreadId;n }n }]);nn return FountainContext;n}();nnfunction fountainContext(fun) {n var fountainContext = new FountainContext();n return fun(fountainContext.fountainGetter.bind(fountainContext));n}nnvar EZII3DStickMan = fountainContext(function (fountainGetter) {n var EZII3DCuboid =n /*#__PURE__*/n function () {n function EZII3DCuboid(width, height, depth, skipAddingToScene) {n _classCallCheck(this, EZII3DCuboid);nn this.width = void 0;n this.height = void 0;n this.depth = void 0;n this.width = width;n this.height = height;n this.depth = depth;n this.skipAddingToScene;n this.renderInitially();n }nn _createClass(EZII3DCuboid, [{n key: "renderInitially",n value: function renderInitially() {n var threeJsScene = arguments.length > 0 && arguments !== undefined ? arguments : window.threeJsScene;n var skipAddingToScene = arguments.length > 1 && arguments !== undefined ? arguments : this.skipAddingToScene;n var geometry = new THREE.BoxGeometry(this.width, this.height, this.depth);n var material = new THREE.MeshBasicMaterial({n color: 0x00ff00n });n var cuboid = new THREE.Mesh(geometry, material);nn if (!skipAddingToScene) {n // threeJsScene.add( cuboid );n var fountain = fountainGetter();n fountain.eZii3dStickManThreeJsGroup.add(cuboid);n }nn this.threeJsMesh = cuboid;n }n }]);nn return EZII3DCuboid;n }();nn var EZII3DStickMan =n /*#__PURE__*/n function () {n function EZII3DStickMan() {n var _this = this;nn _classCallCheck(this, EZII3DStickMan);nn var fountain = fountainGetter('stick man threejs group for all meshes and sub groups');n fountain.eZii3dStickManThreeJsGroup = new THREE.Group();n this.eZii3dStickManThreeJsGroup = fountain.eZii3dStickManThreeJsGroup;n fountain.aroundFountain(function () {n _this.torso = new EZII3DStickManTorso();n });n window.threeJsScene.add(fountain.eZii3dStickManThreeJsGroup);n this.positionInitially();n window.threeJsScene.remove(fountain.eZii3dStickManThreeJsGroup);n }nn _createClass(EZII3DStickMan, [{n key: "show",n value: function show(position) {n this.eZii3dStickManThreeJsGroup.position.x = position.x;n this.eZii3dStickManThreeJsGroup.position.y = position.y + 20; // stick man should appear a bit higher on the y axis than the green small characternn this.eZii3dStickManThreeJsGroup.position.z = position.z;n window.threeJsScene.add(this.eZii3dStickManThreeJsGroup);n }n }, {n key: "positionInitially",n value: function positionInitially() {n this.torso.head.eZii3dCuboid.threeJsMesh.position.y = 20;n this.torso.eZii3dCuboid.threeJsMesh.position.y = -30;n this.torso.arms.leftShoulderHolder.eZii3dCuboid.threeJsMesh.position.x = -30;n this.torso.arms.leftArm.eZii3dCuboid.threeJsMesh.position.y = -50;n this.torso.arms.leftArm.eZii3dCuboid.threeJsMesh.position.x = -30;n this.torso.arms.rightShoulderHolder.eZii3dCuboid.threeJsMesh.position.x = +30;n this.torso.arms.rightArm.eZii3dCuboid.threeJsMesh.position.y = -50;n this.torso.arms.rightArm.eZii3dCuboid.threeJsMesh.position.x = 30;n this.torso.legs.leftLeg.eZii3dCuboid.threeJsMesh.position.y = -150;n this.torso.legs.leftLeg.eZii3dCuboid.threeJsMesh.position.x = -20;n this.torso.legs.rightLeg.eZii3dCuboid.threeJsMesh.position.y = -150;n this.torso.legs.rightLeg.eZii3dCuboid.threeJsMesh.position.x = 20;n this.torso.arms.leftArm.position(-1); // x ddirection is givennn this.torso.arms.rightArm.position(+1); // x ddirection is givenn }n }]);nn return EZII3DStickMan;n }();nn var EZII3DStickManHead = function EZII3DStickManHead() {n _classCallCheck(this, EZII3DStickManHead);nn this.eZii3dCuboid = new EZII3DCuboid(10, 20, 10);n };nn var EZII3DStickManTorso = function EZII3DStickManTorso() {n _classCallCheck(this, EZII3DStickManTorso);nn this.eZii3dCuboid = new EZII3DCuboid(42, 70, 10);n this.head = new EZII3DStickManHead();n this.arms = new EZII3DStickManArms();n this.legs = new EZII3DStickManLegs();n };nn var EZII3DStickManArms = function EZII3DStickManArms() {n _classCallCheck(this, EZII3DStickManArms);nn this.leftArm = new EZII3DStickManArm();n this.rightArm = new EZII3DStickManArm();n this.rightShoulderHolder = new EZII3DStickManShoulderHolder();n this.leftShoulderHolder = new EZII3DStickManShoulderHolder();n };nn var EZII3DStickManShoulderHolder = function EZII3DStickManShoulderHolder() {n _classCallCheck(this, EZII3DStickManShoulderHolder);nn this.eZii3dCuboid = new EZII3DCuboid(10, 10, 10);n };nn var EZII3DStickManLegs = function EZII3DStickManLegs() {n _classCallCheck(this, EZII3DStickManLegs);nn this.leftLeg = new EZII3DStickManLeg();n this.rightLeg = new EZII3DStickManLeg();n };nn var EZII3DStickManLeg = function EZII3DStickManLeg() {n _classCallCheck(this, EZII3DStickManLeg);nn this.eZii3dCuboid = new EZII3DCuboid(15, 100, 10);n };nn var EZII3DStickManArm =n /*#__PURE__*/n function () {n _createClass(EZII3DStickManArm, [{n key: "tiltUpwards",n value: function tiltUpwards() {n this.eZii3dGroup.rotateX(1);n }n }, {n key: "tiltDownwards",n value: function tiltDownwards() {n this.eZii3dGroup.rotateX(-1); // window.currentlySelectedObject.position.z += 20;n }n }, {n key: "beforeFinishedRendering",n value: function beforeFinishedRendering() {n this.shoulderSphere.threeJsMesh.material.color.setHex(0xff0000);n this.eZii3dGroup.add(this.eZii3dCuboid.threeJsMesh);n this.eZii3dGroup.add(this.shoulderSphere.threeJsMesh);n var fountain = fountainGetter();n fountain.eZii3dStickManThreeJsGroup.add(this.eZii3dGroup);n }n }, {n key: "position",n value: function position(xDirection) {n // positioning of arms is done in the 3dStickMaan class atm [ƒ: position()]n this.shoulderSphere.threeJsMesh.position.x += 30 * xDirection;n }n }]);nn function EZII3DStickManArm() {n _classCallCheck(this, EZII3DStickManArm);nn this.eZii3dCuboid = new EZII3DCuboid(10, 75, 7, true);n this.shoulderSphere = new EZII3DCuboid(10, 10, 10, true);n this.eZii3dGroup = new THREE.Group();n this.threeJsScene = window.threeJsScene; // ladder((main) => { this.threeJsScene = main.scene }nn this.beforeFinishedRendering();n this.addClickHandler();n }nn _createClass(EZII3DStickManArm, [{n key: "addClickHandler",n value: function addClickHandler() {n var _this2 = this;nn this.eZii3dCuboid.threeJsMesh.on('click', function (evt) {n // alert('test');n window.currentlySelectedObject = _this2;nn _this2.eZii3dCuboid.threeJsMesh.material.color.setHex(0x0000ff);n });n }n }]);nn return EZII3DStickManArm;n }();nn return EZII3DStickMan;n});nexport default EZII3DStickMan;”,“map”:{“version”:3,“sources”:[“/Users/lemonandroid/Banal Dropbox/random/redux-os/app/javascript/packs/eZii-bricklayer-game/3d-stick-man.js.erb”],“names”:,“m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A9B,CAAuCE,KAAvC,CAA6CkC,MAA7C,CAAoD,QAApD;AACA,SAJD;AAKA;AA9L6D;;AAAA;AAAA;;AAkM/D,SAAO/C,cAAP;AACA,CAnMqC,CAAtC;AAsMA,eAAeA,cAAf”,“sourcesContent”:[“import * as THREE from 'three';nnn// use of "test" strings signals this is unfinishednclass Fountain {ntconstructor(fountainContext) {nttthis.fountainContext = fountainContext;nt}ntntaroundFountain(fn) {nttthis.fountainContext.aroundFountain(this, () => {ntttfn.call(); // a "fountainGetter()" call in this .call, should always return this fountain, how?nttt// consider a multi threaded environment, and two contexts a and b executee fountainGetter at the same time. How would the logic at [1] know, which fountain to return?nttt// maybe the fountains for aroundFountain calls could be stored by thread id? or call scope id (i.e. stack frame id)?ntt})nt}n}nnnclass FountainContext {ntfountains = {}ntfountainsForThreadId = {}ntntntfountainGetter(identifier = undefined) {nttif(identifier !== undefined) {ntttthis.fountains = new Fountain(this);ntttreturn this.fountains;ntt} else {ntttconsole.warn(this.caller);ntttreturn this.fountainsForThreadId;ntt}nt}ntntaroundFountain(fountain, fn) {nttthis.fountainsForThreadId = fountain;nttfn.call();nttdelete this.fountainsForThreadId;nt}n}nnnfunction fountainContext(fun) {ntconst fountainContext = new FountainContext();ntreturn fun(fountainContext.fountainGetter.bind(fountainContext));n}nnnconst EZII3DStickMan = fountainContext(function(fountainGetter) {nnntclass EZII3DCuboid {nttwidth;nttheight;nttdepth;ntnt constructor(width, height, depth, skipAddingToScene) { nt this.width = width;nt this.height = height;ntt this.depth = depth;nt ntt this.skipAddingToScene;nt ntt this.renderInitially()nt }ntntnttrenderInitially(threeJsScene = window.threeJsScene, skipAddingToScene = this.skipAddingToScene) {ntttvar geometry = new THREE.BoxGeometry( this.width, this.height, this.depth );ntttvar material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );nttntttlet cuboid = new THREE.Mesh( geometry, material );nttnttntttif(!skipAddingToScene) { ntttt// threeJsScene.add( cuboid );nttttnttttlet fountain = fountainGetter();nttttnttttfountain.eZii3dStickManThreeJsGroup.add(cuboid);nttt}nttnttntttthis.threeJsMesh = cuboid; ntt}nt}nntclass EZII3DStickMan {ntnttconstructor() {ntttlet fountain = fountainGetter('stick man threejs group for all meshes and sub groups');ntttntttntttfountain.eZii3dStickManThreeJsGroup = new THREE.Group();ntttntttthis.eZii3dStickManThreeJsGroup = fountain.eZii3dStickManThreeJsGroup;ntttntttfountain.aroundFountain(() => {nttttthis.torso = new EZII3DStickManTorso();nttt})ntttntttwindow.threeJsScene.add(fountain.eZii3dStickManThreeJsGroup);ntttntttthis.positionInitially();ntttntttwindow.threeJsScene.remove(fountain.eZii3dStickManThreeJsGroup);ntt}nttnttnttshow(position) {ntttthis.eZii3dStickManThreeJsGroup.position.x = position.x;ntttthis.eZii3dStickManThreeJsGroup.position.y = position.y + 20; // stick man should appear a bit higher on the y axis than the green small characterntttthis.eZii3dStickManThreeJsGroup.position.z = position.z;ntttntttntttwindow.threeJsScene.add(this.eZii3dStickManThreeJsGroup);ntt}ntnttpositionInitially() {ntttthis.torso.head.eZii3dCuboid.threeJsMesh.position.y = 20;ntttthis.torso.eZii3dCuboid.threeJsMesh.position.y = -30;nttnttntttthis.torso.arms.leftShoulderHolder.eZii3dCuboid.threeJsMesh.position.x = -30;nttntttthis.torso.arms.leftArm.eZii3dCuboid.threeJsMesh.position.y = -50;ntttthis.torso.arms.leftArm.eZii3dCuboid.threeJsMesh.position.x = -30;nttnttntttthis.torso.arms.rightShoulderHolder.eZii3dCuboid.threeJsMesh.position.x = +30;nttntttthis.torso.arms.rightArm.eZii3dCuboid.threeJsMesh.position.y = -50;ntttthis.torso.arms.rightArm.eZii3dCuboid.threeJsMesh.position.x = 30;nttnttntttthis.torso.legs.leftLeg.eZii3dCuboid.threeJsMesh.position.y = -150;ntttthis.torso.legs.leftLeg.eZii3dCuboid.threeJsMesh.position.x = -20;nttntttthis.torso.legs.rightLeg.eZii3dCuboid.threeJsMesh.position.y = -150;ntttthis.torso.legs.rightLeg.eZii3dCuboid.threeJsMesh.position.x = 20;nttttnttttnttttntttthis.torso.arms.leftArm.position(-1); // x ddirection is givenntttthis.torso.arms.rightArm.position(+1); // x ddirection is givenntt}nt}nnnntclass EZII3DStickManHead {ntteZii3dCuboid = new EZII3DCuboid(10, 20, 10);nt}nnntclass EZII3DStickManTorso {ntteZii3dCuboid = new EZII3DCuboid(42t, 70, 10);ntthead = new EZII3DStickManHead();nttarms = new EZII3DStickManArms();nttlegs = new EZII3DStickManLegs();nt}nnntclass EZII3DStickManArms {nttleftArm = new EZII3DStickManArm();nttrightArm = new EZII3DStickManArm();ntnttrightShoulderHolder = new EZII3DStickManShoulderHolder();nttleftShoulderHolder = new EZII3DStickManShoulderHolder();nt}nnntclass EZII3DStickManShoulderHolder {ntteZii3dCuboid = new EZII3DCuboid(10, 10, 10);nt}nnntclass EZII3DStickManLegs {nttleftLeg = new EZII3DStickManLeg();nttrightLeg = new EZII3DStickManLeg();nt}nnntclass EZII3DStickManLeg {ntteZii3dCuboid = new EZII3DCuboid(15, 100, 10);ntnt}nnntclass EZII3DStickManArm {ntteZii3dCuboid = new EZII3DCuboid(10, 75, 7, true);ntnttshoulderSphere = new EZII3DCuboid(10, 10, 10, true);ntntteZii3dGroup = new THREE.Group();ntntttiltUpwards() {ntttthis.eZii3dGroup.rotateX(1);ntt}ntntttiltDownwards() {ntttthis.eZii3dGroup.rotateX(-1);nttt// window.currentlySelectedObject.position.z += 20;ntt}ntntnttbeforeFinishedRendering() {nttntttthis.shoulderSphere.threeJsMesh.material.color.setHex(0xff0000);ntttthis.eZii3dGroup.add(this.eZii3dCuboid.threeJsMesh);ntttthis.eZii3dGroup.add(this.shoulderSphere.threeJsMesh);nttntttlet fountain = fountainGetter();ntttntttfountain.eZii3dStickManThreeJsGroup.add(this.eZii3dGroup);ntt}ntntnttposition(xDirection) {nttt// positioning of arms is done in the 3dStickMaan class atm [ƒ: position()]ntttthis.shoulderSphere.threeJsMesh.position.x += 30 * xDirectionntt}ntnttconstructor() {nttntttthis.threeJsScene = window.threeJsScene // ladder((main) => { this.threeJsScene = main.scene }ntttthis.beforeFinishedRendering();nttnttntttthis.addClickHandler();ntt}ntnttaddClickHandler() {ntttthis.eZii3dCuboid.threeJsMesh.on('click', (evt) => {ntttt// alert('test');nttttwindow.currentlySelectedObject = this;nttttthis.eZii3dCuboid.threeJsMesh.material.color.setHex(0x0000ff);nttt});ntt}nt}nnntreturn EZII3DStickMan;n})nnnexport default EZII3DStickMan;nn”]},“metadata”:{},“sourceType”:“module”}