Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
859f5077
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,发现更多精彩内容 >>
提交
859f5077
编写于
8月 13, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
1de68da7
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
82 addition
and
59 deletion
+82
-59
build/three.js
build/three.js
+68
-46
build/three.min.js
build/three.min.js
+14
-13
未找到文件。
build/three.js
浏览文件 @
859f5077
...
...
@@ -3466,48 +3466,52 @@ THREE.Box3.prototype = {
},
setFromPoints: function ( points
) {
addPoint: function ( point
) {
if ( point
s.length > 0
) {
if ( point
.x < this.min.x
) {
var point = points[ 0 ]
;
this.min.x = point.x
;
this.min.copy( point );
this.max.copy( point );
} else if ( point.x > this.max.x ) {
for ( var i = 1, il = points.length; i < il; i ++ ) {
this.max.x = point.x;
point = points[ i ];
}
if ( point.x < this.min.x
) {
if ( point.y < this.min.y
) {
this.min.x = point.x
;
this.min.y = point.y
;
} else if ( point.x > this.max.x
) {
} else if ( point.y > this.max.y
) {
this.max.x = point.x
;
this.max.y = point.y
;
}
}
if ( point.y < this.min.y
) {
if ( point.z < this.min.z
) {
this.min.y = point.y
;
this.min.z = point.z
;
} else if ( point.y > this.max.y
) {
} else if ( point.z > this.max.z
) {
this.max.y = point.y
;
this.max.z = point.z
;
}
}
if ( point.z < this.min.z ) {
},
this.min.z = point.z;
setFromPoints: function ( points ) {
} else if ( point.z > this.max.z
) {
if ( points.length > 0
) {
this.max.z = point.z
;
var point = points[ 0 ]
;
}
this.min.copy( point );
this.max.copy( point );
for ( var i = 1, il = points.length; i < il; i ++ ) {
this.addPoint( points[ i ] )
}
...
...
@@ -5505,25 +5509,30 @@ THREE.Sphere.prototype = {
setFromPoints: function () {
var _box = new THREE.Box3();
var _center = new THREE.Vector3();
var box = new THREE.Box3();
return function ( points, optionalCenter ) {
// use boundingBox center as sphere center
var center = this.center;
if ( optionalCenter !== undefined ) {
var center = optionalCenter || _box.setFromPoints( points ).center( _center );
center.copy( optionalCenter );
} else {
box.setFromPoints( points ).center( center );
}
var maxRadiusSq = 0;
for ( var i = 0, il = points.length; i < il; i ++ ) {
var radiusSq = center.distanceToSquared( points[ i ] );
maxRadiusSq = Math.max( maxRadiusSq, radiusSq );
maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );
}
this.center.copy( center );
this.radius = Math.sqrt( maxRadiusSq );
return this;
...
...
@@ -9108,35 +9117,48 @@ THREE.BufferGeometry.prototype = {
computeBoundingSphere: function () {
if ( this.boundingSphere === null ) {
var box = new THREE.Box3();
var vector = new THREE.Vector3();
this.boundingSphere = new THREE.Sphere();
return function () {
}
if ( this.boundingSphere === null ) {
var positions = this.attributes[ "position" ].array
;
this.boundingSphere = new THREE.Sphere()
;
if ( positions ) {
}
var radiusSq, maxRadiusSq = 0;
var x, y, z;
var positions = this.attributes[ "position" ].array;
for ( var i = 0, il = positions.length; i < il; i += 3
) {
if ( positions
) {
x = positions[ i ];
y = positions[ i + 1 ];
z = positions[ i + 2 ];
var center = this.boundingSphere.center;
radiusSq = x * x + y * y + z * z;
if ( radiusSq > maxRadiusSq ) maxRadiusSq = radiusSq;
for ( var i = 0, il = positions.length; i < il; i += 3 ) {
}
vector.set( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] );
box.addPoint( vector );
}
box.center( center );
var maxRadiusSq = 0;
for ( var i = 0, il = positions.length; i < il; i += 3 ) {
this.boundingSphere.radius = Math.sqrt( maxRadiusSq );
vector.set( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] );
maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );
}
this.boundingSphere.radius = Math.sqrt( maxRadiusSq );
}
}
},
}
()
,
computeVertexNormals: function () {
...
...
@@ -11223,7 +11245,7 @@ THREE.BufferGeometryLoader.prototype = {
if ( boundingSphere !== undefined ) {
geometry.boundingSphere = new THREE.Sphere(
undefined
, boundingSphere.radius );
geometry.boundingSphere = new THREE.Sphere(
boundingSphere.center
, boundingSphere.radius );
}
...
...
build/three.min.js
浏览文件 @
859f5077
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录