提交 7c291f6f 编写于 作者: M Mr.doob

Updated builds.

上级 cf9f8ee1
......@@ -21288,8 +21288,8 @@
var ipd = cameraLPos.distanceTo( cameraRPos );
var projL = cameraL.projectionMatrix;
var projR = cameraR.projectionMatrix;
var projL = cameraL.projectionMatrix.elements;
var projR = cameraR.projectionMatrix.elements;
// VR systems will have identical far and near planes, and
// most likely identical top and bottom frustum extents.
......@@ -21308,13 +21308,13 @@
// Calculate the new camera's position offset from the
// left camera.
var zOffset = ipd / ( leftFovL + rightFovR );
var zOffset = ipd / ( leftFovL - rightFovR );
var xOffset = zOffset * leftFovL;
// TODO: Better way to apply this offset?
cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );
camera.translateX( xOffset );
camera.translateZ( - zOffset );
camera.translateZ( - zOffset * 2 );
camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );
camera.matrixWorldInverse.getInverse( camera.matrixWorld );
......@@ -133,8 +133,8 @@ if(1016===a){if(c.isWebGL2)return 5131;var d=b.get("OES_texture_half_float");if(
if(206===a)return 772;if(207===a)return 773;if(208===a)return 774;if(209===a)return 775;if(210===a)return 776;if(33776===a||33777===a||33778===a||33779===a)if(d=b.get("WEBGL_compressed_texture_s3tc"),null!==d){if(33776===a)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===a)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===a)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===a||35841===a||35842===a||35843===a)if(d=b.get("WEBGL_compressed_texture_pvrtc"),
null!==d){if(35840===a)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===a)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===a&&(d=b.get("WEBGL_compressed_texture_etc1"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL;if(37808===a||37809===a||37810===a||37811===a||37812===a||37813===a||37814===a||37815===a||37816===a||37817===a||37818===a||37819===a||37820===a||37821===a)if(d=b.get("WEBGL_compressed_texture_astc"),
null!==d)return a;if(103===a||104===a){if(c.isWebGL2){if(103===a)return 32775;if(104===a)return 32776}d=b.get("EXT_blend_minmax");if(null!==d){if(103===a)return d.MIN_EXT;if(104===a)return d.MAX_EXT}}if(1020===a){if(c.isWebGL2)return 34042;d=b.get("WEBGL_depth_texture");if(null!==d)return d.UNSIGNED_INT_24_8_WEBGL}return 0}}}function Ob(){B.call(this);this.type="Group"}function Ra(){B.call(this);this.type="Camera";this.matrixWorldInverse=new P;this.projectionMatrix=new P;this.projectionMatrixInverse=
new P}function V(a,b,c,d){Ra.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 Cc(a){V.call(this);this.cameras=a||[]}function df(a,b,c){ef.setFromMatrixPosition(b.matrixWorld);ff.setFromMatrixPosition(c.matrixWorld);var d=ef.distanceTo(ff),e=b.projectionMatrix,f=c.projectionMatrix;c=e[14]/
(e[10]-1);var g=e[14]/(e[10]+1),h=(e[8]-1)/e[0],k=(f[8]+1)/f[0],m=h*c,r=k*c,n=c*(e[9]+1)/e[5],q=c*(f[9]+1)/f[5];e=c*(e[9]-1)/e[5];f=c*(f[9]-1)/f[5];k=d/(h+k);h*=k;b.matrixWorld.decompose(a.position,a.quaternion,a.scale);a.translateX(h);a.translateZ(-k);a.matrixWorld.compose(a.position,a.quaternion,a.scale);a.matrixWorldInverse.getInverse(a.matrixWorld);a.projectionMatrix.makePerspective(m-h,r+(d-h),Math.max(n,q),Math.min(e,f),c+k,g+k)}function gf(a){function b(){return null!==e&&!0===e.isPresenting}
new P}function V(a,b,c,d){Ra.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 Cc(a){V.call(this);this.cameras=a||[]}function df(a,b,c){ef.setFromMatrixPosition(b.matrixWorld);ff.setFromMatrixPosition(c.matrixWorld);var d=ef.distanceTo(ff),e=b.projectionMatrix.elements,f=c.projectionMatrix.elements;
c=e[14]/(e[10]-1);var g=e[14]/(e[10]+1),h=(e[8]-1)/e[0],k=(f[8]+1)/f[0],m=h*c,r=k*c,n=c*(e[9]+1)/e[5],q=c*(f[9]+1)/f[5];e=c*(e[9]-1)/e[5];f=c*(f[9]-1)/f[5];k=d/(h-k);h*=k;b.matrixWorld.decompose(a.position,a.quaternion,a.scale);a.translateX(h);a.translateZ(2*-k);a.matrixWorld.compose(a.position,a.quaternion,a.scale);a.matrixWorldInverse.getInverse(a.matrixWorld);a.projectionMatrix.makePerspective(m-h,r+(d-h),Math.max(n,q),Math.min(e,f),c+k,g+k)}function gf(a){function b(){return null!==e&&!0===e.isPresenting}
function c(){if(b()){var c=e.getEyeParameters("left"),f=c.renderWidth*r;c=c.renderHeight*r;H=a.getPixelRatio();v=a.getSize();a.setDrawingBufferSize(2*f,c,1);I.start()}else d.enabled&&a.setDrawingBufferSize(v.width,v.height,H),I.stop()}var d=this,e=null,f=null,g=null,h=[],k=new P,m=new P,r=1,n="stage";"undefined"!==typeof window&&"VRFrameData"in window&&(f=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",c,!1));var q=new P,w=new ja,l=new p,u=new V;u.bounds=new Z(0,0,.5,1);u.layers.enable(1);
var x=new V;x.bounds=new Z(.5,0,.5,1);x.layers.enable(2);var y=new Cc([u,x]);y.layers.enable(1);y.layers.enable(2);var v,H,G=[];this.enabled=!1;this.getController=function(a){var b=h[a];void 0===b&&(b=new Ob,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);I.setContext(a)};this.setFramebufferScaleFactor=function(a){r=a};this.setFrameOfReferenceType=function(a){n=a};this.setPoseTarget=function(a){void 0!==a&&(g=a)};
this.getCamera=function(a){var b="stage"===n?1.6:0;if(null===e)return a.position.set(0,b,0),a;e.depthNear=a.near;e.depthFar=a.far;e.getFrameData(f);if("stage"===n){var c=e.stageParameters;c?k.fromArray(c.sittingToStandingTransform):k.makeTranslation(0,b,0)}b=f.pose;c=null!==g?g:a;c.matrix.copy(k);c.matrix.decompose(c.position,c.quaternion,c.scale);null!==b.orientation&&(w.fromArray(b.orientation),c.quaternion.multiply(w));null!==b.position&&(w.setFromRotationMatrix(k),l.fromArray(b.position),l.applyQuaternion(w),
......
......@@ -21282,8 +21282,8 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) {
var ipd = cameraLPos.distanceTo( cameraRPos );
var projL = cameraL.projectionMatrix;
var projR = cameraR.projectionMatrix;
var projL = cameraL.projectionMatrix.elements;
var projR = cameraR.projectionMatrix.elements;
// VR systems will have identical far and near planes, and
// most likely identical top and bottom frustum extents.
......@@ -21302,13 +21302,13 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) {
// Calculate the new camera's position offset from the
// left camera.
var zOffset = ipd / ( leftFovL + rightFovR );
var zOffset = ipd / ( leftFovL - rightFovR );
var xOffset = zOffset * leftFovL;
// TODO: Better way to apply this offset?
cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );
camera.translateX( xOffset );
camera.translateZ( - zOffset );
camera.translateZ( - zOffset * 2 );
camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );
camera.matrixWorldInverse.getInverse( camera.matrixWorld );
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册