Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
b4f4549f
T
three.js
项目概览
Ablesons
/
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,发现更多精彩内容 >>
未验证
提交
b4f4549f
编写于
8月 29, 2018
作者:
M
Mr.doob
提交者:
GitHub
8月 29, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14805 from mrdoob/webvr
WebVRManager: Removed userHeight.
上级
f468cf5b
cea165eb
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
42 addition
and
20 deletion
+42
-20
examples/js/vr/WebVR.js
examples/js/vr/WebVR.js
+4
-4
src/Three.Legacy.js
src/Three.Legacy.js
+21
-0
src/renderers/webvr/WebVRManager.js
src/renderers/webvr/WebVRManager.js
+10
-9
src/renderers/webvr/WebXRManager.js
src/renderers/webvr/WebXRManager.js
+7
-7
未找到文件。
examples/js/vr/WebVR.js
浏览文件 @
b4f4549f
...
@@ -9,6 +9,9 @@ var WEBVR = {
...
@@ -9,6 +9,9 @@ var WEBVR = {
createButton
:
function
(
renderer
,
options
)
{
createButton
:
function
(
renderer
,
options
)
{
if
(
options
===
undefined
)
options
=
{};
if
(
options
.
frameOfReferenceType
===
undefined
)
options
.
frameOfReferenceType
=
'
stage
'
;
function
showEnterVR
(
device
)
{
function
showEnterVR
(
device
)
{
button
.
style
.
display
=
''
;
button
.
style
.
display
=
''
;
...
@@ -28,7 +31,7 @@ var WEBVR = {
...
@@ -28,7 +31,7 @@ var WEBVR = {
};
};
renderer
.
vr
.
setDevice
(
device
);
renderer
.
vr
.
setDevice
(
device
,
options
);
}
}
...
@@ -38,9 +41,6 @@ var WEBVR = {
...
@@ -38,9 +41,6 @@ var WEBVR = {
function
onSessionStarted
(
session
)
{
function
onSessionStarted
(
session
)
{
if
(
options
===
undefined
)
options
=
{};
if
(
options
.
frameOfReferenceType
===
undefined
)
options
.
frameOfReferenceType
=
'
stage
'
;
session
.
addEventListener
(
'
end
'
,
onSessionEnded
);
session
.
addEventListener
(
'
end
'
,
onSessionEnded
);
renderer
.
vr
.
setSession
(
session
,
options
);
renderer
.
vr
.
setSession
(
session
,
options
);
...
...
src/Three.Legacy.js
浏览文件 @
b4f4549f
...
@@ -1683,6 +1683,27 @@ Object.defineProperties( WebGLRenderTarget.prototype, {
...
@@ -1683,6 +1683,27 @@ Object.defineProperties( WebGLRenderTarget.prototype, {
//
//
Object
.
defineProperties
(
WebVRManager
.
prototype
,
{
standing
:
{
set
:
function
(
/* value */
)
{
console
.
warn
(
'
THREE.WebVRManager: .standing has been removed.
'
);
}
},
userHeight
:
{
set
:
function
(
/* value */
)
{
console
.
warn
(
'
THREE.WebVRManager: .userHeight has been removed.
'
);
}
}
}
);
//
Audio
.
prototype
.
load
=
function
(
file
)
{
Audio
.
prototype
.
load
=
function
(
file
)
{
console
.
warn
(
'
THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.
'
);
console
.
warn
(
'
THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.
'
);
...
...
src/renderers/webvr/WebVRManager.js
浏览文件 @
b4f4549f
...
@@ -24,6 +24,8 @@ function WebVRManager( renderer ) {
...
@@ -24,6 +24,8 @@ function WebVRManager( renderer ) {
var
standingMatrix
=
new
Matrix4
();
var
standingMatrix
=
new
Matrix4
();
var
standingMatrixInverse
=
new
Matrix4
();
var
standingMatrixInverse
=
new
Matrix4
();
var
options
=
{
frameOfReferenceType
:
'
stage
'
};
if
(
typeof
window
!==
'
undefined
'
&&
'
VRFrameData
'
in
window
)
{
if
(
typeof
window
!==
'
undefined
'
&&
'
VRFrameData
'
in
window
)
{
frameData
=
new
window
.
VRFrameData
();
frameData
=
new
window
.
VRFrameData
();
...
@@ -173,8 +175,6 @@ function WebVRManager( renderer ) {
...
@@ -173,8 +175,6 @@ function WebVRManager( renderer ) {
//
//
this
.
enabled
=
false
;
this
.
enabled
=
false
;
this
.
userHeight
=
1.6
;
this
.
standing
=
false
;
this
.
getController
=
function
(
id
)
{
this
.
getController
=
function
(
id
)
{
...
@@ -200,11 +200,12 @@ function WebVRManager( renderer ) {
...
@@ -200,11 +200,12 @@ function WebVRManager( renderer ) {
};
};
this
.
setDevice
=
function
(
value
)
{
this
.
setDevice
=
function
(
_device
,
_options
)
{
if
(
value
!==
undefined
)
device
=
value
;
if
(
_device
!==
undefined
)
device
=
_device
;
if
(
_options
!==
undefined
)
options
=
_options
;
animation
.
setContext
(
valu
e
);
animation
.
setContext
(
_devic
e
);
};
};
...
@@ -218,7 +219,7 @@ function WebVRManager( renderer ) {
...
@@ -218,7 +219,7 @@ function WebVRManager( renderer ) {
if
(
device
===
null
)
{
if
(
device
===
null
)
{
camera
.
position
.
set
(
0
,
scope
.
userHeight
,
0
);
camera
.
position
.
set
(
0
,
1.6
,
0
);
return
camera
;
return
camera
;
}
}
...
@@ -230,7 +231,7 @@ function WebVRManager( renderer ) {
...
@@ -230,7 +231,7 @@ function WebVRManager( renderer ) {
//
//
if
(
this
.
standing
)
{
if
(
options
.
frameOfReferenceType
===
'
stage
'
)
{
var
stageParameters
=
device
.
stageParameters
;
var
stageParameters
=
device
.
stageParameters
;
...
@@ -240,7 +241,7 @@ function WebVRManager( renderer ) {
...
@@ -240,7 +241,7 @@ function WebVRManager( renderer ) {
}
else
{
}
else
{
standingMatrix
.
makeTranslation
(
0
,
scope
.
userHeight
,
0
);
standingMatrix
.
makeTranslation
(
0
,
1.6
,
0
);
}
}
...
@@ -292,7 +293,7 @@ function WebVRManager( renderer ) {
...
@@ -292,7 +293,7 @@ function WebVRManager( renderer ) {
standingMatrixInverse
.
getInverse
(
standingMatrix
);
standingMatrixInverse
.
getInverse
(
standingMatrix
);
if
(
this
.
standing
)
{
if
(
options
.
frameOfReferenceType
===
'
stage
'
)
{
cameraL
.
matrixWorldInverse
.
multiply
(
standingMatrixInverse
);
cameraL
.
matrixWorldInverse
.
multiply
(
standingMatrixInverse
);
cameraR
.
matrixWorldInverse
.
multiply
(
standingMatrixInverse
);
cameraR
.
matrixWorldInverse
.
multiply
(
standingMatrixInverse
);
...
...
src/renderers/webvr/WebXRManager.js
浏览文件 @
b4f4549f
...
@@ -71,10 +71,10 @@ function WebXRManager( renderer ) {
...
@@ -71,10 +71,10 @@ function WebXRManager( renderer ) {
};
};
this
.
setDevice
=
function
(
valu
e
)
{
this
.
setDevice
=
function
(
_devic
e
)
{
if
(
value
!==
undefined
)
device
=
valu
e
;
if
(
_device
!==
undefined
)
device
=
_devic
e
;
if
(
value
instanceof
XRDevice
)
gl
.
setCompatibleXRDevice
(
valu
e
);
if
(
_device
instanceof
XRDevice
)
gl
.
setCompatibleXRDevice
(
_devic
e
);
};
};
...
@@ -94,9 +94,9 @@ function WebXRManager( renderer ) {
...
@@ -94,9 +94,9 @@ function WebXRManager( renderer ) {
}
}
this
.
setSession
=
function
(
value
,
options
)
{
this
.
setSession
=
function
(
_session
,
_
options
)
{
session
=
value
;
session
=
_session
;
if
(
session
!==
null
)
{
if
(
session
!==
null
)
{
...
@@ -106,9 +106,9 @@ function WebXRManager( renderer ) {
...
@@ -106,9 +106,9 @@ function WebXRManager( renderer ) {
session
.
addEventListener
(
'
end
'
,
onSessionEnd
);
session
.
addEventListener
(
'
end
'
,
onSessionEnd
);
session
.
baseLayer
=
new
XRWebGLLayer
(
session
,
gl
);
session
.
baseLayer
=
new
XRWebGLLayer
(
session
,
gl
);
session
.
requestFrameOfReference
(
options
.
frameOfReferenceType
).
then
(
function
(
value
)
{
session
.
requestFrameOfReference
(
_options
.
frameOfReferenceType
).
then
(
function
(
_frameOfRef
)
{
frameOfRef
=
value
;
frameOfRef
=
_frameOfRef
;
renderer
.
setFramebuffer
(
session
.
baseLayer
.
framebuffer
);
renderer
.
setFramebuffer
(
session
.
baseLayer
.
framebuffer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录