Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
5a0323ac
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 搜索 >>
提交
5a0323ac
编写于
2月 08, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replaced startsWidth and endsWidth with regexp. See #3003.
上级
e1b70079
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
35 deletion
+14
-35
examples/js/loaders/MTLLoader.js
examples/js/loaders/MTLLoader.js
+1
-1
examples/js/loaders/OBJLoader.js
examples/js/loaders/OBJLoader.js
+5
-5
examples/js/loaders/OBJMTLLoader.js
examples/js/loaders/OBJMTLLoader.js
+5
-5
src/Three.js
src/Three.js
+0
-21
src/loaders/Loader.js
src/loaders/Loader.js
+1
-1
src/loaders/SceneLoader.js
src/loaders/SceneLoader.js
+2
-2
未找到文件。
examples/js/loaders/MTLLoader.js
浏览文件 @
5a0323ac
...
...
@@ -401,7 +401,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
THREE
.
MTLLoader
.
loadTexture
=
function
(
url
,
mapping
,
onLoad
,
onError
)
{
var
isCompressed
=
url
.
toLowerCase
().
endsWith
(
"
.dds
"
);
var
isCompressed
=
/
\.
dds$/i
.
test
(
url
);
if
(
isCompressed
)
{
...
...
examples/js/loaders/OBJLoader.js
浏览文件 @
5a0323ac
...
...
@@ -382,7 +382,7 @@ THREE.OBJLoader.prototype = {
}
}
else
if
(
line
.
startsWith
(
"
o
"
)
)
{
}
else
if
(
/^o /
.
test
(
line
)
)
{
// object
...
...
@@ -390,23 +390,23 @@ THREE.OBJLoader.prototype = {
object
.
name
=
line
.
substring
(
2
).
trim
();
group
.
add
(
object
);
}
else
if
(
line
.
startsWith
(
"
g
"
)
)
{
}
else
if
(
/^g /
.
test
(
line
)
)
{
// group
meshN
(
line
.
substring
(
2
).
trim
(),
undefined
);
}
else
if
(
line
.
startsWith
(
"
usemtl
"
)
)
{
}
else
if
(
/^usemtl /
.
test
(
line
)
)
{
// material
meshN
(
undefined
,
line
.
substring
(
7
).
trim
()
);
}
else
if
(
line
.
startsWith
(
"
mtllib
"
)
)
{
}
else
if
(
/^mtllib /
.
test
(
line
)
)
{
// mtl file
}
else
if
(
line
.
startsWith
(
"
s
"
)
)
{
}
else
if
(
/^s /
.
test
(
line
)
)
{
// smooth shading
...
...
examples/js/loaders/OBJMTLLoader.js
浏览文件 @
5a0323ac
...
...
@@ -518,7 +518,7 @@ THREE.OBJMTLLoader.prototype = {
}
}
else
if
(
line
.
startsWith
(
"
o
"
)
)
{
}
else
if
(
/^o /
.
test
(
line
)
)
{
// object
...
...
@@ -526,19 +526,19 @@ THREE.OBJMTLLoader.prototype = {
object
.
name
=
line
.
substring
(
2
).
trim
();
group
.
add
(
object
);
}
else
if
(
line
.
startsWith
(
"
g
"
)
)
{
}
else
if
(
/^g /
.
test
(
line
)
)
{
// group
meshN
(
line
.
substring
(
2
).
trim
(),
undefined
);
}
else
if
(
line
.
startsWith
(
"
usemtl
"
)
)
{
}
else
if
(
/^usemtl /
.
test
(
line
)
)
{
// material
meshN
(
undefined
,
line
.
substring
(
7
).
trim
()
);
}
else
if
(
line
.
startsWith
(
"
mtllib
"
)
)
{
}
else
if
(
/^mtllib /
.
test
(
line
)
)
{
// mtl file
...
...
@@ -550,7 +550,7 @@ THREE.OBJMTLLoader.prototype = {
}
}
else
if
(
line
.
startsWith
(
"
s
"
)
)
{
}
else
if
(
/^s /
.
test
(
line
)
)
{
// Smooth shading
...
...
src/Three.js
浏览文件 @
5a0323ac
...
...
@@ -18,27 +18,6 @@ self.console = self.console || {
self
.
Int32Array
=
self
.
Int32Array
||
Array
;
self
.
Float32Array
=
self
.
Float32Array
||
Array
;
// Shims for "startsWith", "endsWith", and "trim" for browsers where this is not yet implemented
// not sure we should have this, or at least not have it here
// http://stackoverflow.com/questions/646628/javascript-startswith
// http://stackoverflow.com/questions/498970/how-do-i-trim-a-string-in-javascript
// http://wiki.ecmascript.org/doku.php?id=harmony%3astring_extras
String
.
prototype
.
startsWith
=
String
.
prototype
.
startsWith
||
function
(
str
)
{
return
this
.
slice
(
0
,
str
.
length
)
===
str
;
};
String
.
prototype
.
endsWith
=
String
.
prototype
.
endsWith
||
function
(
str
)
{
var
t
=
String
(
str
);
var
index
=
this
.
lastIndexOf
(
t
);
return
(
-
1
<
index
&&
index
)
===
(
this
.
length
-
t
.
length
);
};
String
.
prototype
.
trim
=
String
.
prototype
.
trim
||
function
()
{
return
this
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
...
...
src/loaders/Loader.js
浏览文件 @
5a0323ac
...
...
@@ -145,7 +145,7 @@ THREE.Loader.prototype = {
function
create_texture
(
where
,
name
,
sourceFile
,
repeat
,
offset
,
wrap
,
anisotropy
)
{
var
isCompressed
=
sourceFile
.
toLowerCase
().
endsWith
(
"
.dds
"
);
var
isCompressed
=
/
\.
dds$/i
.
test
(
sourceFile
);
var
fullPath
=
texturePath
+
"
/
"
+
sourceFile
;
if
(
isCompressed
)
{
...
...
src/loaders/SceneLoader.js
浏览文件 @
5a0323ac
...
...
@@ -903,7 +903,7 @@ THREE.SceneLoader.prototype.parse = function ( json, callbackFinished, url ) {
}
var
isCompressed
=
url_array
[
0
].
endsWith
(
"
.dds
"
);
var
isCompressed
=
/
\.
dds$/i
.
test
(
url_array
[
0
]
);
if
(
isCompressed
)
{
...
...
@@ -917,7 +917,7 @@ THREE.SceneLoader.prototype.parse = function ( json, callbackFinished, url ) {
}
else
{
var
isCompressed
=
textureJSON
.
url
.
toLowerCase
().
endsWith
(
"
.dds
"
);
var
isCompressed
=
/
\.
dds$/i
.
test
(
textureJSON
.
url
);
var
fullUrl
=
get_url
(
textureJSON
.
url
,
data
.
urlBaseType
);
var
textureCallback
=
generateTextureCallback
(
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录