"use strict";(self.webpackChunkfirebird=self.webpackChunkfirebird||[]).push([[1899],{1899:(y,h,l)=>{l.r(h),l.d(h,{PlaygroundComponent:()=>u});var o=l(4701),d=l(3973),m=l(6927),s=l(1360);const p=["rendererContainer"];let u=(()=>{class c{constructor(){this.lines=[],this.curves=[],this.trajectories=[[{x:0,y:0,z:0,time:1e3},{x:1,y:1,z:0,time:2e3},{x:2,y:0,z:1,time:3e3},{x:3,y:-1,z:0,time:4e3},{x:4,y:0,z:-1,time:5e3}],[{x:4,y:0,z:-1,time:5e3},{x:5,y:1,z:-1,time:6e3},{x:6,y:2,z:0,time:7e3},{x:7,y:1,z:1,time:8e3},{x:8,y:0,z:1,time:9e3}],[{x:8,y:0,z:1,time:5e3},{x:9,y:-1,z:1,time:6e3},{x:10,y:-2,z:0,time:7e3},{x:11,y:-1,z:-1,time:8e3},{x:12,y:0,z:-1,time:9e3}]]}ngOnInit(){}ngAfterViewInit(){this.initThreeJS(),this.initCurvesAndLines(),this.animate()}initThreeJS(){this.scene=new o.Z58,this.camera=new o.ubm(75,window.innerWidth/window.innerHeight,.1,1e3),this.camera.position.z=5,this.renderer=new d.JeP,this.renderer.setSize(window.innerWidth,window.innerHeight),this.rendererContainer.nativeElement.appendChild(this.renderer.domElement);const n=new o.Gu$(.1,32,32),t=new o.V9B({color:16711680});this.particle1=new o.eaF(n,t),this.particle2=new o.eaF(n,t),this.particle1.visible=!1,this.particle2.visible=!1,this.scene.add(this.particle1),this.scene.add(this.particle2)}initCurvesAndLines(){this.curves=this.trajectories.map(n=>new o.B6O(n.map(t=>new o.Pq0(t.x,t.y,t.z)))),this.curves.forEach(n=>{const t=n.getPoints(100),i=(new o.LoY).setFromPoints(t),e=new o.mrM({color:255}),r=new o.N1A(i,e);r.visible=!1,this.scene.add(r),this.lines.push(r)})}updateParticlePosition(n){if(n<1e3)return this.particle1.visible=!1,this.particle2.visible=!1,void this.lines.forEach(e=>e.visible=!1);this.particle1.visible=!0,this.particle2.visible=n>=5e3;let i=n-1e3;if(i<=4e3){this.lines[0].visible=!0;const e=i/4e3,r=this.curves[0].getPoint(e);this.particle1.position.copy(r);const a=this.curves[0].getPoints(Math.floor(100*e)+1);this.lines[0].geometry.setFromPoints(a)}if(i>=4e3&&i<=8e3){this.lines[1].visible=!0;const e=(i-4e3)/4e3,r=this.curves[1].getPoint(e);this.particle1.position.copy(r);const a=this.curves[1].getPoints(Math.floor(100*e)+1);this.lines[1].geometry.setFromPoints(a)}if(i>=4e3&&i<=8e3){this.lines[2].visible=!0;const e=(i-4e3)/4e3,r=this.curves[2].getPoint(e);this.particle2.position.copy(r);const a=this.curves[2].getPoints(Math.floor(100*e)+1);this.lines[2].geometry.setFromPoints(a)}}setAnimationTime(n){const i=parseInt(n.target.value,10);this.updateParticlePosition(i)}animate(){requestAnimationFrame(()=>this.animate()),m.yo(),this.renderer.render(this.scene,this.camera)}static{this.\u0275fac=function(t){return new(t||c)}}static{this.\u0275cmp=s.VBU({type:c,selectors:[["app-playground"]],viewQuery:function(t,i){if(1&t&&s.GBs(p,5),2&t){let e;s.mGM(e=s.lsd())&&(i.rendererContainer=e.first)}},decls:6,vars:0,consts:[["rendererContainer",""],["id","controls"],["type","range","id","timeSlider","min","0","max","9000","step","10","value","0",3,"input"],[2,"border","solid 1px blue"]],template:function(t,i){if(1&t){const e=s.RV6();s.j41(0,"p"),s.EFF(1,"playground works!"),s.k0s(),s.j41(2,"div",1)(3,"input",2),s.bIt("input",function(a){return s.eBV(e),s.Njj(i.setAnimationTime(a))}),s.k0s()(),s.nrm(4,"div",3,0)}},styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}#controls[_ngcontent-%COMP%]{position:absolute;top:10px;left:10px;z-index:100}.renderer-container[_ngcontent-%COMP%]{width:100%;height:100%}"]})}}return c})()}}]);