Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
81de0318
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,发现更多精彩内容 >>
提交
81de0318
编写于
5月 31, 2019
作者:
M
Morgan Villedieu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Final working version of the Polyfill
上级
1acd3d89
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
42 addition
and
34 deletion
+42
-34
examples/js/vr/HelioWebXRPolyfill.js
examples/js/vr/HelioWebXRPolyfill.js
+26
-20
examples/js/vr/WebVR.js
examples/js/vr/WebVR.js
+0
-6
examples/webvr_ballshooter.html
examples/webvr_ballshooter.html
+1
-1
examples/webvr_cubes.html
examples/webvr_cubes.html
+2
-1
examples/webvr_dragging.html
examples/webvr_dragging.html
+1
-0
examples/webvr_lorenzattractor.html
examples/webvr_lorenzattractor.html
+1
-1
examples/webvr_paint.html
examples/webvr_paint.html
+1
-1
examples/webvr_panorama.html
examples/webvr_panorama.html
+1
-1
examples/webvr_rollercoaster.html
examples/webvr_rollercoaster.html
+1
-1
examples/webvr_sandbox.html
examples/webvr_sandbox.html
+1
-0
examples/webvr_sculpt.html
examples/webvr_sculpt.html
+2
-0
examples/webvr_video.html
examples/webvr_video.html
+2
-1
examples/webvr_vive_paint.html
examples/webvr_vive_paint.html
+1
-0
examples/webvr_vive_sculpt.html
examples/webvr_vive_sculpt.html
+2
-0
src/renderers/webvr/WebXRManager.js
src/renderers/webvr/WebXRManager.js
+0
-1
未找到文件。
examples/js/vr/Polyfill.js
→
examples/js/vr/
HelioWebXR
Polyfill.js
浏览文件 @
81de0318
if
(
'
xr
'
in
navigator
&&
/
(
Helio
)
/g
.
test
(
navigator
.
userAgent
))
{
if
(
'
xr
'
in
navigator
)
{
console
.
log
(
'
Helio - (Chrome m73) WebXR Polyfill
'
,
navigator
.
xr
);
console
.
log
(
'
Helio WebXR Polyfill
'
,
navigator
.
xr
);
// WebXRManager - XR.supportSession() Polyfill - WebVR.js line 147
navigator
.
xr
.
supportsSession
=
navigator
.
xr
.
supportsSessionMode
;
if
(
'
supportsSession
'
in
navigator
.
xr
===
false
)
navigator
.
xr
.
supportsSession
=
navigator
.
xr
.
supportsSessionMode
;
if
(
'
supportsSessionMode
'
in
navigator
.
xr
)
{
if
(
'
requestSession
'
in
navigator
.
xr
)
{
const
tempRequestSession
=
navigator
.
xr
.
requestSession
.
bind
(
navigator
.
xr
);
navigator
.
xr
.
requestSession
=
function
(
sessionType
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
tempRequestSession
({
mode
:
sessionType
})
.
then
(
session
=>
{
tempRequestSession
({
mode
:
sessionType
})
.
then
(
function
(
session
)
{
// WebXRManager - xrFrame.getPose() Polyfill - line 279
...
...
@@ -31,11 +31,11 @@ if( 'xr' in navigator ) {
const
tempGetViewerPose
=
frame
.
getViewerPose
.
bind
(
frame
);
frame
.
getViewerPose
=
function
(
referenceSpace
)
{
frame
.
getViewerPose
=
function
(
referenceSpace
)
{
const
pose
=
tempGetViewerPose
(
referenceSpace
);
const
pose
=
tempGetViewerPose
(
referenceSpace
);
pose
.
views
.
forEach
(
view
=>
{
pose
.
views
.
forEach
(
function
(
view
)
{
view
.
transform
=
{
inverse
:
{
...
...
@@ -63,11 +63,11 @@ if( 'xr' in navigator ) {
}
callback
(
time
,
frame
)
;
callback
(
time
,
frame
)
})
}
;
}
// WebXRManager - xrFrame.getPose( inputSource.targetRaySpace, referenceSpace) Polyfill - line 279
...
...
@@ -83,9 +83,9 @@ if( 'xr' in navigator ) {
get
:
function
()
{
return
xrInputSource
},
})
;
})
})
;
})
return
res
;
}
...
...
@@ -98,7 +98,9 @@ if( 'xr' in navigator ) {
// WebXRManager - xrSession.updateRenderState() Polyfill Line 129
session
.
updateRenderState
=
function
({
baseLayer
})
{
session
.
updateRenderState
=
function
({
baseLayer
})
{
session
.
baseLayer
=
baseLayer
;
...
...
@@ -116,13 +118,19 @@ if( 'xr' in navigator ) {
session
.
requestReferenceSpace
=
function
()
{
return
temp
({
type
:
'
stationary
'
,
subtype
:
'
floor-level
'
});
return
temp
({
type
:
'
stationary
'
,
subtype
:
'
floor-level
'
})
}
resolve
(
session
);
});
})
.
catch
(
function
(
error
)
{
return
reject
(
error
);
})
})
}
...
...
@@ -130,5 +138,3 @@ if( 'xr' in navigator ) {
}
}
examples/js/vr/WebVR.js
浏览文件 @
81de0318
...
...
@@ -48,8 +48,6 @@ var WEBVR = {
function
onSessionStarted
(
session
)
{
console
.
log
(
session
);
session
.
addEventListener
(
'
end
'
,
onSessionEnded
);
renderer
.
vr
.
setSession
(
session
);
...
...
@@ -135,16 +133,12 @@ var WEBVR = {
}
console
.
log
(
navigator
);
if
(
'
xr
'
in
navigator
)
{
console
.
log
(
'
test
'
);
var
button
=
document
.
createElement
(
'
button
'
);
button
.
style
.
display
=
'
none
'
;
stylizeElement
(
button
);
console
.
log
(
navigator
.
xr
)
navigator
.
xr
.
supportsSession
(
sessionType
).
then
(
showEnterXR
);
return
button
;
...
...
examples/webvr_ballshooter.html
浏览文件 @
81de0318
...
...
@@ -12,8 +12,8 @@
<a
href=
"https://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webvr - ball shooter
</div>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/Polyfill.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
<script
src=
"js/geometries/BoxLineGeometry.js"
></script>
...
...
examples/webvr_cubes.html
浏览文件 @
81de0318
...
...
@@ -11,7 +11,8 @@
<div
id=
"info"
>
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webgl - interactive cubes
</div>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
...
...
examples/webvr_dragging.html
浏览文件 @
81de0318
...
...
@@ -12,6 +12,7 @@
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webvr - dragging
</div>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
...
...
examples/webvr_lorenzattractor.html
浏览文件 @
81de0318
...
...
@@ -8,8 +8,8 @@
</head>
<body>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
<script>
...
...
examples/webvr_paint.html
浏览文件 @
81de0318
...
...
@@ -12,9 +12,9 @@
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webvr - paint
</div>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
<script
src=
"js/loaders/OBJLoader.js"
></script>
<script>
...
...
examples/webvr_panorama.html
浏览文件 @
81de0318
...
...
@@ -7,8 +7,8 @@
<link
type=
"text/css"
rel=
"stylesheet"
href=
"main.css"
>
</head>
<body>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
<script>
...
...
examples/webvr_rollercoaster.html
浏览文件 @
81de0318
...
...
@@ -8,10 +8,10 @@
</head>
<body>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/RollerCoaster.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
<script>
...
...
examples/webvr_sandbox.html
浏览文件 @
81de0318
...
...
@@ -8,6 +8,7 @@
</head>
<body>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/objects/Lensflare.js"
></script>
...
...
examples/webvr_sculpt.html
浏览文件 @
81de0318
...
...
@@ -12,6 +12,8 @@
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webvr - sculpt
</div>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
...
...
examples/webvr_video.html
浏览文件 @
81de0318
...
...
@@ -14,8 +14,9 @@
stereoscopic panoramic render by
<a
href=
"http://pedrofe.com/rendering-for-oculus-rift-with-arnold/"
target=
"_blank"
rel=
"noopener"
>
pedrofe
</a>
. scene from
<a
href=
"http://www.meryproject.com/"
target=
"_blank"
rel=
"noopener"
>
mery project
</a>
.
</div>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
<video
id=
"video"
loop
muted
crossOrigin=
"anonymous"
webkit-playsinline
style=
"display:none"
>
...
...
examples/webvr_vive_paint.html
浏览文件 @
81de0318
...
...
@@ -12,6 +12,7 @@
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webgl - htc vive - paint
</div>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/ViveController.js"
></script>
...
...
examples/webvr_vive_sculpt.html
浏览文件 @
81de0318
...
...
@@ -12,9 +12,11 @@
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
webgl - htc vive - sculpt
</div>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/vr/ViveController.js"
></script>
<script
src=
"js/vr/HelioWebXRPolyfill.js"
></script>
<script
src=
"js/vr/WebVR.js"
></script>
<script
src=
"js/loaders/OBJLoader.js"
></script>
...
...
src/renderers/webvr/WebXRManager.js
浏览文件 @
81de0318
...
...
@@ -261,7 +261,6 @@ function WebXRManager( renderer ) {
if
(
inputPose
!==
null
)
{
controller
.
matrix
.
fromArray
(
inputPose
.
transform
.
matrix
);
controller
.
matrix
.
decompose
(
controller
.
position
,
controller
.
rotation
,
controller
.
scale
);
controller
.
visible
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录