Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
b2285b65
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,发现更多精彩内容 >>
提交
b2285b65
编写于
10月 27, 2016
作者:
C
chris van wiemeersch
提交者:
Mr.doob
10月 27, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lint code in VREffect (Mr.doob™ approved) (#9957)
上级
0a7648a8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
23 deletion
+20
-23
examples/js/effects/VREffect.js
examples/js/effects/VREffect.js
+20
-23
未找到文件。
examples/js/effects/VREffect.js
浏览文件 @
b2285b65
...
...
@@ -9,7 +9,7 @@
*
*/
THREE
.
VREffect
=
function
(
renderer
,
onError
)
{
THREE
.
VREffect
=
function
(
renderer
,
onError
)
{
var
vrDisplay
,
vrDisplays
;
var
eyeTranslationL
=
new
THREE
.
Vector3
();
...
...
@@ -20,7 +20,7 @@ THREE.VREffect = function ( renderer, onError ) {
if
(
'
VRFrameData
'
in
window
)
{
frameData
=
new
VRFrameData
();
frameData
=
new
window
.
VRFrameData
();
}
...
...
@@ -42,7 +42,7 @@ THREE.VREffect = function ( renderer, onError ) {
if
(
navigator
.
getVRDisplays
)
{
navigator
.
getVRDisplays
().
then
(
gotVRDisplays
).
catch
(
function
()
{
navigator
.
getVRDisplays
().
then
(
gotVRDisplays
).
catch
(
function
()
{
console
.
warn
(
'
THREE.VREffect: Unable to get VR Displays
'
);
...
...
@@ -61,26 +61,26 @@ THREE.VREffect = function ( renderer, onError ) {
var
rendererUpdateStyle
=
false
;
var
rendererPixelRatio
=
renderer
.
getPixelRatio
();
this
.
getVRDisplay
=
function
()
{
this
.
getVRDisplay
=
function
()
{
return
vrDisplay
;
};
this
.
setVRDisplay
=
function
(
value
)
{
this
.
setVRDisplay
=
function
(
value
)
{
vrDisplay
=
value
;
};
this
.
getVRDisplays
=
function
()
{
this
.
getVRDisplays
=
function
()
{
console
.
warn
(
'
THREE.VREffect: getVRDisplays() is being deprecated.
'
);
return
vrDisplays
;
};
this
.
setSize
=
function
(
width
,
height
,
updateStyle
)
{
this
.
setSize
=
function
(
width
,
height
,
updateStyle
)
{
rendererSize
=
{
width
:
width
,
height
:
height
};
rendererUpdateStyle
=
updateStyle
;
...
...
@@ -100,12 +100,9 @@ THREE.VREffect = function ( renderer, onError ) {
};
//
fullscree
n
//
VR presentatio
n
var
canvas
=
renderer
.
domElement
;
var
requestFullscreen
;
var
exitFullscreen
;
var
fullscreenElement
;
var
defaultLeftBounds
=
[
0.0
,
0.0
,
0.5
,
1.0
];
var
defaultRightBounds
=
[
0.5
,
0.0
,
0.5
,
1.0
];
...
...
@@ -120,7 +117,7 @@ THREE.VREffect = function ( renderer, onError ) {
var
eyeWidth
=
eyeParamsL
.
renderWidth
;
var
eyeHeight
=
eyeParamsL
.
renderHeight
;
if
(
!
wasPresenting
)
{
if
(
!
wasPresenting
)
{
rendererPixelRatio
=
renderer
.
getPixelRatio
();
rendererSize
=
renderer
.
getSize
();
...
...
@@ -141,9 +138,9 @@ THREE.VREffect = function ( renderer, onError ) {
window
.
addEventListener
(
'
vrdisplaypresentchange
'
,
onVRDisplayPresentChange
,
false
);
this
.
setFullScreen
=
function
(
boolean
)
{
this
.
setFullScreen
=
function
(
boolean
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
if
(
vrDisplay
===
undefined
)
{
...
...
@@ -173,19 +170,19 @@ THREE.VREffect = function ( renderer, onError ) {
};
this
.
requestPresent
=
function
()
{
this
.
requestPresent
=
function
()
{
return
this
.
setFullScreen
(
true
);
};
this
.
exitPresent
=
function
()
{
this
.
exitPresent
=
function
()
{
return
this
.
setFullScreen
(
false
);
};
this
.
requestAnimationFrame
=
function
(
f
)
{
this
.
requestAnimationFrame
=
function
(
f
)
{
if
(
vrDisplay
!==
undefined
)
{
...
...
@@ -199,7 +196,7 @@ THREE.VREffect = function ( renderer, onError ) {
};
this
.
cancelAnimationFrame
=
function
(
h
)
{
this
.
cancelAnimationFrame
=
function
(
h
)
{
if
(
vrDisplay
!==
undefined
)
{
...
...
@@ -213,7 +210,7 @@ THREE.VREffect = function ( renderer, onError ) {
};
this
.
submitFrame
=
function
()
{
this
.
submitFrame
=
function
()
{
if
(
vrDisplay
!==
undefined
&&
scope
.
isPresenting
)
{
...
...
@@ -233,7 +230,7 @@ THREE.VREffect = function ( renderer, onError ) {
var
cameraR
=
new
THREE
.
PerspectiveCamera
();
cameraR
.
layers
.
enable
(
2
);
this
.
render
=
function
(
scene
,
camera
,
renderTarget
,
forceClear
)
{
this
.
render
=
function
(
scene
,
camera
,
renderTarget
,
forceClear
)
{
if
(
vrDisplay
&&
scope
.
isPresenting
)
{
...
...
@@ -284,13 +281,13 @@ THREE.VREffect = function ( renderer, onError ) {
x
:
Math
.
round
(
size
.
width
*
leftBounds
[
0
]
),
y
:
Math
.
round
(
size
.
height
*
leftBounds
[
1
]
),
width
:
Math
.
round
(
size
.
width
*
leftBounds
[
2
]
),
height
:
Math
.
round
(
size
.
height
*
leftBounds
[
3
]
)
height
:
Math
.
round
(
size
.
height
*
leftBounds
[
3
]
)
};
renderRectR
=
{
x
:
Math
.
round
(
size
.
width
*
rightBounds
[
0
]
),
y
:
Math
.
round
(
size
.
height
*
rightBounds
[
1
]
),
width
:
Math
.
round
(
size
.
width
*
rightBounds
[
2
]
),
height
:
Math
.
round
(
size
.
height
*
rightBounds
[
3
]
)
height
:
Math
.
round
(
size
.
height
*
rightBounds
[
3
]
)
};
if
(
renderTarget
)
{
...
...
@@ -397,7 +394,7 @@ THREE.VREffect = function ( renderer, onError ) {
};
this
.
dispose
=
function
()
{
this
.
dispose
=
function
()
{
window
.
removeEventListener
(
'
vrdisplaypresentchange
'
,
onVRDisplayPresentChange
,
false
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录