MCPcopy
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / c

Function c

assets/js/space-wrap.js:148–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

146"Camera";this.matrixWorldInverse=new P;this.projectionMatrix=new P;this.projectionMatrixInverse=new P}function ca(a,b,c,d){Xa.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Jc(a){ca.call(this);this.cameras=a||[]}function uf(a,b,c){vf.setFromMatrixPosition(b.matrixWorld);wf.setFromMatrixPosition(c.matrixWorld);
147var d=vf.distanceTo(wf),e=b.projectionMatrix.elements,f=c.projectionMatrix.elements,g=e[14]/(e[10]-1);c=e[14]/(e[10]+1);var h=(e[9]+1)/e[5],l=(e[9]-1)/e[5],m=(e[8]-1)/e[0],q=(f[8]+1)/f[0];e=g*m;f=g*q;q=d/(-m+q);m=q*-m;b.matrixWorld.decompose(a.position,a.quaternion,a.scale);a.translateX(m);a.translateZ(q);a.matrixWorld.compose(a.position,a.quaternion,a.scale);a.matrixWorldInverse.getInverse(a.matrixWorld);b=g+q;g=c+q;a.projectionMatrix.makePerspective(e-m,f+(d-m),h*c/g*b,l*c/g*b,b,g)}function xf(a){function b(){return null!==
148e&&!0===e.isPresenting}function c(){if(b()){var c=e.getEyeParameters("left"),f=c.renderWidth*q;c=c.renderHeight*q;y=a.getPixelRatio();a.getSize(x);a.setDrawingBufferSize(2*f,c,1);G.start()}else d.enabled&&a.setDrawingBufferSize(x.width,x.height,y),G.stop()}var d=this,e=null,f=null,g=null,h=[],l=new P,m=new P,q=1,p="stage";"undefined"!==typeof window&&"VRFrameData"in window&&(f=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",c,!1));var k=new P,t=new ma,r=new n,u=new ca;u.bounds=
149new W(0,0,.5,1);u.layers.enable(1);var w=new ca;w.bounds=new W(.5,0,.5,1);w.layers.enable(2);var z=new Jc([u,w]);z.layers.enable(1);z.layers.enable(2);var x=new C,y,F=[];this.enabled=!1;this.getController=function(a){var b=h[a];void 0===b&&(b=new Xb,b.matrixAutoUpdate=!1,b.visible=!1,h[a]=b);return b};this.getDevice=function(){return e};this.setDevice=function(a){void 0!==a&&(e=a);G.setContext(a)};this.setFramebufferScaleFactor=function(a){q=a};this.setFrameOfReferenceType=function(a){p=a};this.setPoseTarget=
150function(a){void 0!==a&&(g=a)};this.getCamera=function(a){var c="stage"===p?1.6:0;if(!1===b())return a.position.set(0,c,0),a.rotation.set(0,0,0),a;e.depthNear=a.near;e.depthFar=a.far;e.getFrameData(f);if("stage"===p){var d=e.stageParameters;d?l.fromArray(d.sittingToStandingTransform):l.makeTranslation(0,c,0)}c=f.pose;d=null!==g?g:a;d.matrix.copy(l);d.matrix.decompose(d.position,d.quaternion,d.scale);null!==c.orientation&&(t.fromArray(c.orientation),d.quaternion.multiply(t));null!==c.position&&(t.setFromRotationMatrix(l),
151r.fromArray(c.position),r.applyQuaternion(t),d.position.add(r));d.updateMatrixWorld();u.near=a.near;w.near=a.near;u.far=a.far;w.far=a.far;u.matrixWorldInverse.fromArray(f.leftViewMatrix);w.matrixWorldInverse.fromArray(f.rightViewMatrix);m.getInverse(l);"stage"===p&&(u.matrixWorldInverse.multiply(m),w.matrixWorldInverse.multiply(m));a=d.parent;null!==a&&(k.getInverse(a.matrixWorld),u.matrixWorldInverse.multiply(k),w.matrixWorldInverse.multiply(k));u.matrixWorld.getInverse(u.matrixWorldInverse);w.matrixWorld.getInverse(w.matrixWorldInverse);

Callers 6

eFunction · 0.70
jeFunction · 0.70
YaFunction · 0.70
GbFunction · 0.70
bFunction · 0.70
space-wrap.jsFile · 0.70

Calls 6

startMethod · 0.80
bFunction · 0.70
gFunction · 0.70
lFunction · 0.70
kFunction · 0.70
hFunction · 0.70

Tested by

no test coverage detected