<!-- SOLID-PLAYTIME · part 76 -->
uteBoundingBox(),this.boundingBox.getCenter(Lo).negate(),this.translate(Lo.x,Lo.y,Lo.z),this}setFromPoints(t){let e=this.getAttribute("position");if(e===void 0){let n=[];for(let i=0,s=t.length;i<s;i++){let a=t[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Zt(n,3))}else{let n=Math.min(t.length,e.count);for(let i=0;i<n;i++){let s=t[i];e.setXYZ(i,s.x,s.y,s.z||0)}if(t.length>e.count)console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.");e.needsUpdate=!0}return this}computeBoundingBox(){if(this.boundingBox===null)this.boundingBox=new Fs;let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new C(-1/0,-1/0,-1/0),new C(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];if(ui.setFromBufferAttribute(s),this.morphTargetsRelative)yn.addVectors(this.boundingBox.min,ui.min),this.boundingBox.expandByPoint(yn),yn.addVectors(this.boundingBox.max,ui.max),this.boundingBox.expandByPoint(yn);else this.boundingBox.expandByPoint(ui.min),this.boundingBox.expandByPoint(ui.max)}}else this.boundingBox.makeEmpty();if(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){if(this.boundingSphere===null)this.boundingSphere=new Ns;let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new C,1/0);return}if(t){let n=this.boundingSphere.center;if(ui.setFromBufferAttribute(t),e)for(let s=0,a=e.length;s<a;s++){let r=e[s];if(gc.setFromBufferAttribute(r),this.morphTargetsRelative)yn.addVectors(ui.min,gc.min),ui.expandByPoint(yn),yn.addVectors(ui.max,gc.max),ui.expandByPoint(yn);else ui.expandByPoint(gc.min),ui.expandByPoint(gc.max)}ui.getCenter(n);let i=0;for(let s=0,a=t.count;s<a;s++)yn.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(yn));if(e)for(let s=0,a=e.length;s<a;s++){let r=e[s],o=this.morphTargetsRelative;for(let l=0,c=r.count;l<c;l++){if(yn.fromBufferAttribute(r,l),o)Lo.fromBufferAttribute(t,l),yn.add(Lo);i=Math.max(i,n.distanceToSquared(yn))}}if(this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius))console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let{position:n,normal:i,uv:s}=e;if(this.hasAttribute("tangent")===!1)this.setAttribute("tangent",new tn(new Float32Array(4*n.count),4));let a=this.getAttribute("tangent"),r=[],o=[];for(let T=0;T<n.count;T++)r[T]=new C,o[T]=new C;let l=new C,c=new C,u=new C,f=new Nt,h=new Nt,p=new Nt,v=new C,y=new C;function U(T,w,b){l.fromBufferAttribute(n,T),c.fromBufferAttribute(n,w),u.fromBufferAttribute(n,b),f.fromBufferAttribute(s,T),h.fromBufferAttribute(s,w),p.fromBufferAttribute(s,b),c.sub(l),u.sub(l),h.sub(f),p.sub(f);let M=1/(h.x*p.y-p.x*h.y);if(!isFinite(M))return;v.copy(c).multiplyScalar(p.y).addScaledVector(u,-h.y).multiplyScalar(M),y.copy(u).multiplyScalar(h.x).addScaledVector(c,-p.x).multiplyScalar(M),r[T].add(v),r[w].add(v),r[b].add(v),o[T].add(y),o[w].add(y),o[b].add(y)}let d=this.groups;if(d.length===0)d=[{start:0,count:t.count}];for(let T=0,w=d.length;T<w;++T){let b=d[T],{start:M,count:R}=b;for(let O=M,V=M+R;O<V;O+=3)U(t.getX(O+0),t.getX(O+1),t.getX(O+2))}let g=new C,m=new C,x=new C,S=new C;function A(T){x.fromBufferAttribute(i,T),S.copy(x);let w=r[T];g.copy(w),g.sub(x.multiplyScalar(x.dot(w))).normalize(),m.crossVectors(S,w);let M=m.dot(o[T])<0?-1:1;a.setXYZW(T,g.x,g.y,g.z,M)}for(let T=0,w=d.length;T<w;++T){let b=d[T],{start:M,count:R}=b;for(let O=M,V=M+R;O<V;O+=3)A(t.getX(O+0)),A(t.getX(O+1)),A(t.getX(O+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new tn(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let f=0,h=n.count;f<h;f++)n.setXYZ(f,0,0,0);let i=new C,s=new C,a=new C,r=new C,o=new C,l=new C,c=new C,u=new C;if(t)for(let f=0,h=t.count;f<h;f+=3){let p=t.getX(f+0),v=t.getX(f+1),y=t.getX(f+2);i.fromBufferAttribute(e,p),s.fromBufferAttribute(e,v),a.fromBufferAttribute(e,y),c.subVectors(a,s),u.subVectors(i,s),c.cross(u),r.fromBufferAttribute(n,p),o.fr