Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
4ddd90c9
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4ddd90c9
编写于
12月 24, 2019
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
5b13bed9
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
647 addition
and
603 deletion
+647
-603
build/three.js
build/three.js
+58
-36
build/three.min.js
build/three.min.js
+531
-531
build/three.module.js
build/three.module.js
+58
-36
未找到文件。
build/three.js
浏览文件 @
4ddd90c9
...
...
@@ -22863,13 +22863,7 @@
var pose = null;
var controllers = [];
var sortedInputSources = [];
function isPresenting() {
return session !== null && referenceSpace !== null;
}
var inputSourcesMap = new Map();
//
...
...
@@ -22889,6 +22883,8 @@
this.enabled = false;
this.isPresenting = false;
this.getController = function ( id ) {
var controller = controllers[ id ];
...
...
@@ -22911,13 +22907,11 @@
function onSessionEvent( event ) {
for ( var i = 0; i < controllers.length; i ++ ) {
var controller = inputSourcesMap.get( event.inputSource );
if ( sortedInputSources[ i ] === event.inputSource
) {
if ( controller
) {
controllers[ i ].dispatchEvent( { type: event.type } );
}
controller.dispatchEvent( { type: event.type } );
}
...
...
@@ -22925,12 +22919,24 @@
function onSessionEnd() {
inputSourcesMap.forEach( function ( controller, inputSource ) {
controller.dispatchEvent( { type: 'disconnected', data: inputSource } );
} );
inputSourcesMap.clear();
//
renderer.setFramebuffer( null );
renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
animation.stop();
scope.dispatchEvent( { type: 'sessionend' } );
scope.isPresenting = false;
}
function onRequestReferenceSpace( value ) {
...
...
@@ -22942,6 +22948,8 @@
scope.dispatchEvent( { type: 'sessionstart' } );
scope.isPresenting = true;
}
this.setFramebufferScaleFactor = function ( /* value */ ) {
...
...
@@ -22996,33 +23004,52 @@
session.addEventListener( 'inputsourceschange', updateInputSources );
updateInputSources();
}
};
function updateInputSources() {
function updateInputSources( event ) {
console.log( 'inputsourceschange', event, session.inputSources );
var inputSources = session.inputSources;
// Assign inputSources to available controllers
for ( var i = 0; i < controllers.length; i ++ ) {
sortedInputSources[ i ] = findInputSource( i
);
inputSourcesMap.set( inputSources[ i ], controllers[ i ]
);
}
}
// Notify disconnected
function findInputSource( id
) {
for ( var i = 0; i < event.removed.length; i ++
) {
var inputSources = session.inputSources;
var inputSource = event.removed[ i ];
var controller = inputSourcesMap.get( inputSource );
for ( var i = 0; i < inputSources.length; i ++
) {
if ( controller
) {
var inputSource = inputSources[ i ]
;
var handedness = inputSource.handedness
;
controller.dispatchEvent( { type: 'disconnected', data: inputSource } )
;
inputSourcesMap.delete( inputSource )
;
if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) { return inputSource; }
if ( id === 1 && ( handedness === 'left' ) ) { return inputSource; }
}
}
// Notify connected
for ( var i = 0; i < event.added.length; i ++ ) {
var inputSource = event.added[ i ];
var controller = inputSourcesMap.get( inputSource );
if ( controller ) {
controller.dispatchEvent( { type: 'connected', data: inputSource } );
}
}
...
...
@@ -23137,8 +23164,6 @@
};
this.isPresenting = isPresenting;
// Animation Loop
var onAnimationFrameCallback = null;
...
...
@@ -23177,11 +23202,13 @@
//
var inputSources = session.inputSources;
for ( var i = 0; i < controllers.length; i ++ ) {
var controller = controllers[ i ];
var inputSource =
sortedI
nputSources[ i ];
var inputSource =
i
nputSources[ i ];
if ( inputSource ) {
...
...
@@ -23191,12 +23218,7 @@
controller.matrix.fromArray( inputPose.transform.matrix );
controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
if ( inputSource.targetRayMode === 'pointing' ) {
controller.visible = true;
}
controller.visible = true;
continue;
...
...
@@ -23567,7 +23589,7 @@
this.setSize = function ( width, height, updateStyle ) {
if ( xr.isPresenting
()
) {
if ( xr.isPresenting ) {
console.warn( 'THREE.WebGLRenderer: Can\'t change size while VR device is presenting.' );
return;
...
...
@@ -24272,7 +24294,7 @@
function onAnimationFrame( time ) {
if ( xr.isPresenting
()
) { return; }
if ( xr.isPresenting ) { return; }
if ( onAnimationFrameCallback ) { onAnimationFrameCallback( time ); }
}
...
...
@@ -24336,7 +24358,7 @@
if ( camera.parent === null ) { camera.updateMatrixWorld(); }
if ( xr.enabled && xr.isPresenting
()
) {
if ( xr.enabled && xr.isPresenting ) {
camera = xr.getCamera( camera );
build/three.min.js
浏览文件 @
4ddd90c9
此差异已折叠。
点击以展开。
build/three.module.js
浏览文件 @
4ddd90c9
...
...
@@ -22855,13 +22855,7 @@ function WebXRManager( renderer, gl ) {
var pose = null;
var controllers = [];
var sortedInputSources = [];
function isPresenting() {
return session !== null && referenceSpace !== null;
}
var inputSourcesMap = new Map();
//
...
...
@@ -22881,6 +22875,8 @@ function WebXRManager( renderer, gl ) {
this.enabled = false;
this.isPresenting = false;
this.getController = function ( id ) {
var controller = controllers[ id ];
...
...
@@ -22903,13 +22899,11 @@ function WebXRManager( renderer, gl ) {
function onSessionEvent( event ) {
for ( var i = 0; i < controllers.length; i ++ ) {
var controller = inputSourcesMap.get( event.inputSource );
if ( sortedInputSources[ i ] === event.inputSource
) {
if ( controller
) {
controllers[ i ].dispatchEvent( { type: event.type } );
}
controller.dispatchEvent( { type: event.type } );
}
...
...
@@ -22917,12 +22911,24 @@ function WebXRManager( renderer, gl ) {
function onSessionEnd() {
inputSourcesMap.forEach( function ( controller, inputSource ) {
controller.dispatchEvent( { type: 'disconnected', data: inputSource } );
} );
inputSourcesMap.clear();
//
renderer.setFramebuffer( null );
renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
animation.stop();
scope.dispatchEvent( { type: 'sessionend' } );
scope.isPresenting = false;
}
function onRequestReferenceSpace( value ) {
...
...
@@ -22934,6 +22940,8 @@ function WebXRManager( renderer, gl ) {
scope.dispatchEvent( { type: 'sessionstart' } );
scope.isPresenting = true;
}
this.setFramebufferScaleFactor = function ( /* value */ ) {
...
...
@@ -22988,33 +22996,52 @@ function WebXRManager( renderer, gl ) {
session.addEventListener( 'inputsourceschange', updateInputSources );
updateInputSources();
}
};
function updateInputSources() {
function updateInputSources( event ) {
console.log( 'inputsourceschange', event, session.inputSources );
var inputSources = session.inputSources;
// Assign inputSources to available controllers
for ( var i = 0; i < controllers.length; i ++ ) {
sortedInputSources[ i ] = findInputSource( i
);
inputSourcesMap.set( inputSources[ i ], controllers[ i ]
);
}
}
// Notify disconnected
function findInputSource( id
) {
for ( var i = 0; i < event.removed.length; i ++
) {
var inputSources = session.inputSources;
var inputSource = event.removed[ i ];
var controller = inputSourcesMap.get( inputSource );
for ( var i = 0; i < inputSources.length; i ++
) {
if ( controller
) {
var inputSource = inputSources[ i ]
;
var handedness = inputSource.handedness
;
controller.dispatchEvent( { type: 'disconnected', data: inputSource } )
;
inputSourcesMap.delete( inputSource )
;
if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
}
}
// Notify connected
for ( var i = 0; i < event.added.length; i ++ ) {
var inputSource = event.added[ i ];
var controller = inputSourcesMap.get( inputSource );
if ( controller ) {
controller.dispatchEvent( { type: 'connected', data: inputSource } );
}
}
...
...
@@ -23129,8 +23156,6 @@ function WebXRManager( renderer, gl ) {
};
this.isPresenting = isPresenting;
// Animation Loop
var onAnimationFrameCallback = null;
...
...
@@ -23169,11 +23194,13 @@ function WebXRManager( renderer, gl ) {
//
var inputSources = session.inputSources;
for ( var i = 0; i < controllers.length; i ++ ) {
var controller = controllers[ i ];
var inputSource =
sortedI
nputSources[ i ];
var inputSource =
i
nputSources[ i ];
if ( inputSource ) {
...
...
@@ -23183,12 +23210,7 @@ function WebXRManager( renderer, gl ) {
controller.matrix.fromArray( inputPose.transform.matrix );
controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
if ( inputSource.targetRayMode === 'pointing' ) {
controller.visible = true;
}
controller.visible = true;
continue;
...
...
@@ -23559,7 +23581,7 @@ function WebGLRenderer( parameters ) {
this.setSize = function ( width, height, updateStyle ) {
if ( xr.isPresenting
()
) {
if ( xr.isPresenting ) {
console.warn( 'THREE.WebGLRenderer: Can\'t change size while VR device is presenting.' );
return;
...
...
@@ -24264,7 +24286,7 @@ function WebGLRenderer( parameters ) {
function onAnimationFrame( time ) {
if ( xr.isPresenting
()
) return;
if ( xr.isPresenting ) return;
if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
}
...
...
@@ -24328,7 +24350,7 @@ function WebGLRenderer( parameters ) {
if ( camera.parent === null ) camera.updateMatrixWorld();
if ( xr.enabled && xr.isPresenting
()
) {
if ( xr.enabled && xr.isPresenting ) {
camera = xr.getCamera( camera );
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录