Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
5dbbc93b
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,体验更适合开发者的 AI 搜索 >>
提交
5dbbc93b
编写于
1月 19, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
BufferGeometry: Merged setIndex and setIndexArray. See #10603.
上级
8c3d13b9
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
22 addition
and
20 deletion
+22
-20
examples/js/loaders/AssimpJSONLoader.js
examples/js/loaders/AssimpJSONLoader.js
+1
-1
examples/js/loaders/FBXLoader.js
examples/js/loaders/FBXLoader.js
+1
-1
examples/js/loaders/MMDLoader.js
examples/js/loaders/MMDLoader.js
+1
-1
examples/js/loaders/PLYLoader.js
examples/js/loaders/PLYLoader.js
+1
-1
src/core/BufferGeometry.js
src/core/BufferGeometry.js
+6
-4
src/geometries/BoxGeometry.js
src/geometries/BoxGeometry.js
+1
-1
src/geometries/CircleGeometry.js
src/geometries/CircleGeometry.js
+1
-1
src/geometries/CylinderGeometry.js
src/geometries/CylinderGeometry.js
+1
-1
src/geometries/LatheGeometry.js
src/geometries/LatheGeometry.js
+1
-1
src/geometries/ParametricGeometry.js
src/geometries/ParametricGeometry.js
+1
-1
src/geometries/PlaneGeometry.js
src/geometries/PlaneGeometry.js
+1
-1
src/geometries/RingGeometry.js
src/geometries/RingGeometry.js
+1
-1
src/geometries/ShapeGeometry.js
src/geometries/ShapeGeometry.js
+1
-1
src/geometries/SphereGeometry.js
src/geometries/SphereGeometry.js
+1
-1
src/geometries/TorusGeometry.js
src/geometries/TorusGeometry.js
+1
-1
src/geometries/TorusKnotGeometry.js
src/geometries/TorusKnotGeometry.js
+1
-1
src/geometries/TubeGeometry.js
src/geometries/TubeGeometry.js
+1
-1
未找到文件。
examples/js/loaders/AssimpJSONLoader.js
浏览文件 @
5dbbc93b
...
...
@@ -125,7 +125,7 @@ THREE.AssimpJSONLoader.prototype = {
}
geometry
.
setIndex
Array
(
indices
);
geometry
.
setIndex
(
indices
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32BufferAttribute
(
vertices
,
3
)
);
if
(
normals
.
length
>
0
)
{
...
...
examples/js/loaders/FBXLoader.js
浏览文件 @
5dbbc93b
...
...
@@ -263,7 +263,7 @@
if
(
geoNode
.
indices
!==
undefined
&&
geoNode
.
indices
.
length
>
0
)
{
tmpGeo
.
setIndex
Array
(
geoNode
.
indices
);
tmpGeo
.
setIndex
(
geoNode
.
indices
);
}
...
...
examples/js/loaders/MMDLoader.js
浏览文件 @
5dbbc93b
...
...
@@ -1477,7 +1477,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
var
initGeometry
=
function
()
{
geometry
.
setIndex
Array
(
buffer
.
indices
);
geometry
.
setIndex
(
buffer
.
indices
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32BufferAttribute
(
buffer
.
vertices
,
3
)
);
geometry
.
addAttribute
(
'
normal
'
,
new
THREE
.
Float32BufferAttribute
(
buffer
.
normals
,
3
)
);
geometry
.
addAttribute
(
'
uv
'
,
new
THREE
.
Float32BufferAttribute
(
buffer
.
uvs
,
2
)
);
...
...
examples/js/loaders/PLYLoader.js
浏览文件 @
5dbbc93b
...
...
@@ -314,7 +314,7 @@ THREE.PLYLoader.prototype = {
if
(
buffer
.
indices
.
length
>
0
)
{
geometry
.
setIndex
Array
(
buffer
.
indices
);
geometry
.
setIndex
(
buffer
.
indices
);
}
...
...
src/core/BufferGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -52,13 +52,15 @@ BufferGeometry.prototype = {
setIndex
:
function
(
index
)
{
this
.
index
=
index
;
if
(
Array
.
isArray
(
index
)
)
{
},
this
.
index
=
new
(
_Math
.
arrayMax
(
index
)
>
65535
?
Uint32BufferAttribute
:
Uint16BufferAttribute
)(
index
,
1
);
}
else
{
setIndexArray
:
function
(
indices
)
{
this
.
index
=
index
;
this
.
index
=
new
(
_Math
.
arrayMax
(
indices
)
>
65535
?
Uint32BufferAttribute
:
Uint16BufferAttribute
)(
indices
,
1
);
}
},
...
...
src/geometries/BoxGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -82,7 +82,7 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments,
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/CircleGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -106,7 +106,7 @@ function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) {
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/CylinderGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -96,7 +96,7 @@ function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/LatheGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -135,7 +135,7 @@ function LatheBufferGeometry( points, segments, phiStart, phiLength ) {
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/ParametricGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -100,7 +100,7 @@ function ParametricBufferGeometry( func, slices, stacks ) {
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/PlaneGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -112,7 +112,7 @@ function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) {
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/RingGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -137,7 +137,7 @@ function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegment
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/ShapeGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -87,7 +87,7 @@ function ShapeBufferGeometry( shapes, curveSegments ) {
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/SphereGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -137,7 +137,7 @@ function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart,
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/TorusGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -128,7 +128,7 @@ function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/TorusKnotGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -166,7 +166,7 @@ function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments,
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
src/geometries/TubeGeometry.js
浏览文件 @
5dbbc93b
...
...
@@ -101,7 +101,7 @@ function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, clos
// build geometry
this
.
setIndex
Array
(
indices
);
this
.
setIndex
(
indices
);
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
this
.
addAttribute
(
'
uv
'
,
new
Float32BufferAttribute
(
uvs
,
2
)
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录