Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
06c18861
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
06c18861
编写于
9月 07, 2017
作者:
S
siyangy
提交者:
unacao
9月 07, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Dreamview: Update objloader (#1612)
上级
09abf177
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
29 deletion
+17
-29
modules/dreamview/frontend/dist/app.bundle.js
modules/dreamview/frontend/dist/app.bundle.js
+4
-18
modules/dreamview/frontend/dist/app.bundle.js.map
modules/dreamview/frontend/dist/app.bundle.js.map
+1
-1
modules/dreamview/frontend/package.json
modules/dreamview/frontend/package.json
+1
-2
modules/dreamview/frontend/src/renderer/map.js
modules/dreamview/frontend/src/renderer/map.js
+6
-4
modules/dreamview/frontend/src/utils/models.js
modules/dreamview/frontend/src/utils/models.js
+2
-4
modules/dreamview/frontend/webpack.config.js
modules/dreamview/frontend/webpack.config.js
+3
-0
未找到文件。
modules/dreamview/frontend/dist/app.bundle.js
浏览文件 @
06c18861
此差异已折叠。
点击以展开。
modules/dreamview/frontend/dist/app.bundle.js.map
浏览文件 @
06c18861
此差异已折叠。
点击以展开。
modules/dreamview/frontend/package.json
浏览文件 @
06c18861
...
...
@@ -18,8 +18,7 @@
"react"
:
"^15.5.4"
,
"react-dom"
:
"^15.5.4"
,
"three"
:
"~0.84.0"
,
"three-line-2d"
:
"^1.1.6"
,
"three-obj-loader"
:
"^1.1.2"
"three-line-2d"
:
"^1.1.6"
},
"devDependencies"
:
{
"babel-core"
:
"^6.24.1"
,
...
...
modules/dreamview/frontend/src/renderer/map.js
浏览文件 @
06c18861
...
...
@@ -163,11 +163,12 @@ function getLaneHeading(lane) {
}
function
getSignalPositionAndHeading
(
signal
,
overlapMap
,
laneHeading
,
coordinates
)
{
let
locations
=
_
.
pickBy
(
let
locations
=
_
.
pickBy
(
_
.
mapValues
(
signal
.
subsignal
,
obj
=>
obj
.
location
),
v
=>
!
_
.
isEmpty
(
v
));
if
(
_
.
isEmpty
(
locations
))
{
locations
=
_
.
attempt
(()
=>
signal
.
boundary
.
point
);
if
(
_
.
isEmpty
(
locations
))
{
locations
=
_
.
attempt
(()
=>
signal
.
boundary
.
point
);
}
if
(
_
.
isError
(
locations
)
||
locations
===
undefined
)
{
return
null
;
}
...
...
@@ -210,7 +211,7 @@ function addTrafficLight(signal, overlapMap, laneHeading, coordinates, scene) {
const
posAndHeadings
=
[];
const
posAndHeading
=
getSignalPositionAndHeading
(
signal
,
overlapMap
,
laneHeading
,
coordinates
);
if
(
posAndHeading
)
{
const
scale
=
0.0
06
;
const
scale
=
0.0
1
;
loadObject
(
trafficLightMaterial
,
trafficLightObject
,
{
x
:
scale
,
y
:
scale
,
z
:
scale
},
mesh
=>
{
...
...
@@ -219,6 +220,7 @@ function addTrafficLight(signal, overlapMap, laneHeading, coordinates, scene) {
mesh
.
position
.
set
(
posAndHeading
[
0
].
x
,
posAndHeading
[
0
].
y
,
0
);
mesh
.
matrixAutoUpdate
=
false
;
mesh
.
updateMatrix
();
scene
.
add
(
mesh
);
drewObjects
.
push
(
mesh
);
});
...
...
modules/dreamview/frontend/src/utils/models.js
浏览文件 @
06c18861
import
*
as
THREE
from
"
three
"
;
import
OBJLoader
from
"
three/examples/js/loaders/OBJLoader.js
"
;
import
MTLLoader
from
"
three/examples/js/loaders/MTLLoader.js
"
;
import
OBJLoader
from
"
three-obj-loader
"
;
OBJLoader
(
THREE
);
// The two loaders for material and object files, respectively.
const
mtlLoader
=
new
THREE
.
MTLLoader
();
...
...
@@ -14,7 +12,6 @@ const loadedMaterialAndObject = {};
export
function
loadObject
(
materialFile
,
objectFile
,
scale
,
callback
)
{
function
placeMtlAndObj
(
loaded
)
{
const
object
=
loaded
.
clone
();
object
.
scale
.
set
(
scale
.
x
,
scale
.
y
,
scale
.
z
);
if
(
callback
)
{
callback
(
object
);
}
...
...
@@ -27,6 +24,7 @@ export function loadObject(materialFile, objectFile, scale, callback) {
objLoader
.
setMaterials
(
materials
);
objLoader
.
load
(
objectFile
,
loaded
=>
{
loaded
.
name
=
objectFile
;
loaded
.
scale
.
set
(
scale
.
x
,
scale
.
y
,
scale
.
z
);
loadedMaterialAndObject
[
objectFile
]
=
loaded
;
placeMtlAndObj
(
loaded
);
});
...
...
modules/dreamview/frontend/webpack.config.js
浏览文件 @
06c18861
...
...
@@ -80,6 +80,9 @@ module.exports = {
},
{
test
:
require
.
resolve
(
"
three/examples/js/loaders/MTLLoader.js
"
),
use
:
"
imports-loader?THREE=three
"
},
{
test
:
require
.
resolve
(
"
three/examples/js/loaders/OBJLoader.js
"
),
use
:
"
imports-loader?THREE=three
"
},
{
// Load the images. They goes through image-webpack-loader
// first, and then file-loader.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录