Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
2401418c
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,发现更多精彩内容 >>
提交
2401418c
编写于
2月 24, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
a54c8a56
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
119 addition
and
130 deletion
+119
-130
build/three.js
build/three.js
+66
-77
build/three.min.js
build/three.min.js
+53
-53
未找到文件。
build/three.js
浏览文件 @
2401418c
...
...
@@ -2979,15 +2979,9 @@ THREE.Euler.prototype = {
setFromRotationMatrix: function ( m, order ) {
// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
// clamp, to handle numerical problems
var clamp = THREE.Math.clamp;
function clamp( x ) {
return Math.min( Math.max( x, -1 ), 1 );
}
// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
var te = m.elements;
var m11 = te[0], m12 = te[4], m13 = te[8];
...
...
@@ -2998,7 +2992,7 @@ THREE.Euler.prototype = {
if ( order === 'XYZ' ) {
this._y = Math.asin( clamp( m13 ) );
this._y = Math.asin( clamp( m13
, -1, 1
) );
if ( Math.abs( m13 ) < 0.99999 ) {
...
...
@@ -3014,7 +3008,7 @@ THREE.Euler.prototype = {
} else if ( order === 'YXZ' ) {
this._x = Math.asin( - clamp( m23 ) );
this._x = Math.asin( - clamp( m23
, -1, 1
) );
if ( Math.abs( m23 ) < 0.99999 ) {
...
...
@@ -3030,7 +3024,7 @@ THREE.Euler.prototype = {
} else if ( order === 'ZXY' ) {
this._x = Math.asin( clamp( m32 ) );
this._x = Math.asin( clamp( m32
, -1, 1
) );
if ( Math.abs( m32 ) < 0.99999 ) {
...
...
@@ -3046,7 +3040,7 @@ THREE.Euler.prototype = {
} else if ( order === 'ZYX' ) {
this._y = Math.asin( - clamp( m31 ) );
this._y = Math.asin( - clamp( m31
, -1, 1
) );
if ( Math.abs( m31 ) < 0.99999 ) {
...
...
@@ -3062,7 +3056,7 @@ THREE.Euler.prototype = {
} else if ( order === 'YZX' ) {
this._z = Math.asin( clamp( m21 ) );
this._z = Math.asin( clamp( m21
, -1, 1
) );
if ( Math.abs( m21 ) < 0.99999 ) {
...
...
@@ -3078,7 +3072,7 @@ THREE.Euler.prototype = {
} else if ( order === 'XZY' ) {
this._z = Math.asin( - clamp( m12 ) );
this._z = Math.asin( - clamp( m12
, -1, 1
) );
if ( Math.abs( m12 ) < 0.99999 ) {
...
...
@@ -3108,15 +3102,9 @@ THREE.Euler.prototype = {
setFromQuaternion: function ( q, order, update ) {
// q is assumed to be normalized
// clamp, to handle numerical problems
function clamp( x ) {
var clamp = THREE.Math.clamp;
return Math.min( Math.max( x, -1 ), 1 );
}
// q is assumed to be normalized
// http://www.mathworks.com/matlabcentral/fileexchange/20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/content/SpinCalc.m
...
...
@@ -3130,38 +3118,38 @@ THREE.Euler.prototype = {
if ( order === 'XYZ' ) {
this._x = Math.atan2( 2 * ( q.x * q.w - q.y * q.z ), ( sqw - sqx - sqy + sqz ) );
this._y = Math.asin( clamp( 2 * ( q.x * q.z + q.y * q.w ) ) );
this._y = Math.asin( clamp( 2 * ( q.x * q.z + q.y * q.w )
, -1, 1
) );
this._z = Math.atan2( 2 * ( q.z * q.w - q.x * q.y ), ( sqw + sqx - sqy - sqz ) );
} else if ( order === 'YXZ' ) {
this._x = Math.asin( clamp( 2 * ( q.x * q.w - q.y * q.z ) ) );
this._x = Math.asin( clamp( 2 * ( q.x * q.w - q.y * q.z )
, -1, 1
) );
this._y = Math.atan2( 2 * ( q.x * q.z + q.y * q.w ), ( sqw - sqx - sqy + sqz ) );
this._z = Math.atan2( 2 * ( q.x * q.y + q.z * q.w ), ( sqw - sqx + sqy - sqz ) );
} else if ( order === 'ZXY' ) {
this._x = Math.asin( clamp( 2 * ( q.x * q.w + q.y * q.z ) ) );
this._x = Math.asin( clamp( 2 * ( q.x * q.w + q.y * q.z )
, -1, 1
) );
this._y = Math.atan2( 2 * ( q.y * q.w - q.z * q.x ), ( sqw - sqx - sqy + sqz ) );
this._z = Math.atan2( 2 * ( q.z * q.w - q.x * q.y ), ( sqw - sqx + sqy - sqz ) );
} else if ( order === 'ZYX' ) {
this._x = Math.atan2( 2 * ( q.x * q.w + q.z * q.y ), ( sqw - sqx - sqy + sqz ) );
this._y = Math.asin( clamp( 2 * ( q.y * q.w - q.x * q.z ) ) );
this._y = Math.asin( clamp( 2 * ( q.y * q.w - q.x * q.z )
, -1, 1
) );
this._z = Math.atan2( 2 * ( q.x * q.y + q.z * q.w ), ( sqw + sqx - sqy - sqz ) );
} else if ( order === 'YZX' ) {
this._x = Math.atan2( 2 * ( q.x * q.w - q.z * q.y ), ( sqw - sqx + sqy - sqz ) );
this._y = Math.atan2( 2 * ( q.y * q.w - q.x * q.z ), ( sqw + sqx - sqy - sqz ) );
this._z = Math.asin( clamp( 2 * ( q.x * q.y + q.z * q.w ) ) );
this._z = Math.asin( clamp( 2 * ( q.x * q.y + q.z * q.w )
, -1, 1
) );
} else if ( order === 'XZY' ) {
this._x = Math.atan2( 2 * ( q.x * q.w + q.y * q.z ), ( sqw - sqx + sqy - sqz ) );
this._y = Math.atan2( 2 * ( q.x * q.z + q.y * q.w ), ( sqw + sqx - sqy - sqz ) );
this._z = Math.asin( clamp( 2 * ( q.z * q.w - q.x * q.y ) ) );
this._z = Math.asin( clamp( 2 * ( q.z * q.w - q.x * q.y )
, -1, 1
) );
} else {
...
...
@@ -6415,7 +6403,9 @@ THREE.Math = {
}(),
isPowerOfTwo: function ( value ) {
return ( value & ( value - 1 ) ) === 0 && value !== 0;
}
};
...
...
@@ -23418,11 +23408,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function painterSortStable ( a, b ) {
if ( a.materialId !== b.materialId ) {
return b.materialId - a.materialId;
} else if ( a.z !== b.z ) {
if ( a.z !== b.z ) {
return b.z - a.z;
...
...
@@ -23511,7 +23497,6 @@ THREE.WebGLRenderer = function ( parameters ) {
object = webglObject.object;
webglObject.id = i;
webglObject.materialId = object.material.id;
webglObject.render = false;
if ( object.visible ) {
...
...
@@ -23918,80 +23903,85 @@ THREE.WebGLRenderer = function ( parameters ) {
object._modelViewMatrix = new THREE.Matrix4();
object._normalMatrix = new THREE.Matrix3();
if ( object.geometry !== undefined && object.geometry.__webglInit === undefined ) {
geometry = object.geometry;
if ( geometry === undefined ) {
// TODO: Hacky...
object.
geometry.__webglInit
= true;
object.geometry.addEventListener( 'dispose', onGeometryDispose )
;
object.
__webglActive
= true;
return
;
}
geometry = object.geometry;
if ( geometry.__webglInit === undefined ) {
if ( geometry === undefined ) {
geometry.__webglInit = true;
geometry.addEventListener( 'dispose', onGeometryDispose );
// fail silently for now
if ( geometry instanceof THREE.BufferGeometry ) {
} else if ( geometry instanceof THREE.BufferGeometry ) {
initDirectBuffers( geometry );
initDirectBuffers( geometry );
} else if ( object instanceof THREE.Mesh ) {
} else if ( object instanceof THREE.Mesh ) {
material = object.material;
material = object.material;
if ( geometry.geometryGroups === undefined ) {
if ( geometry.geometryGroups === undefined ) {
geometry.makeGroups( material instanceof THREE.MeshFaceMaterial, _glExtensionElementIndexUint ? 4294967296 : 65535 );
geometry.makeGroups( material instanceof THREE.MeshFaceMaterial, _glExtensionElementIndexUint ? 4294967296 : 65535 );
}
}
// create separate VBOs per geometry chunk
// create separate VBOs per geometry chunk
for ( g in geometry.geometryGroups ) {
for ( g in geometry.geometryGroups ) {
geometryGroup = geometry.geometryGroups[ g ];
geometryGroup = geometry.geometryGroups[ g ];
// initialise VBO on the first access
// initialise VBO on the first access
if ( ! geometryGroup.__webglVertexBuffer ) {
if ( ! geometryGroup.__webglVertexBuffer ) {
createMeshBuffers( geometryGroup );
initMeshBuffers( geometryGroup, object );
createMeshBuffers( geometryGroup );
initMeshBuffers( geometryGroup, object );
geometry.verticesNeedUpdate = true;
geometry.morphTargetsNeedUpdate = true;
geometry.elementsNeedUpdate = true;
geometry.uvsNeedUpdate = true;
geometry.normalsNeedUpdate = true;
geometry.tangentsNeedUpdate = true;
geometry.colorsNeedUpdate = true;
geometry.verticesNeedUpdate = true;
geometry.morphTargetsNeedUpdate = true;
geometry.elementsNeedUpdate = true;
geometry.uvsNeedUpdate = true;
geometry.normalsNeedUpdate = true;
geometry.tangentsNeedUpdate = true;
geometry.colorsNeedUpdate = true;
}
}
}
}
else if ( object instanceof THREE.Line ) {
} else if ( object instanceof THREE.Line
) {
if ( ! geometry.__webglVertexBuffer
) {
if ( ! geometry.__webglVertexBuffer ) {
createLineBuffers( geometry );
initLineBuffers( geometry, object );
createLineBuffers( geometry );
initLineBuffers( geometry, object );
geometry.verticesNeedUpdate = true;
geometry.colorsNeedUpdate = true;
geometry.lineDistancesNeedUpdate = true;
geometry.verticesNeedUpdate = true;
geometry.colorsNeedUpdate = true;
geometry.lineDistancesNeedUpdate = true;
}
}
}
else if ( object instanceof THREE.ParticleSystem ) {
} else if ( object instanceof THREE.ParticleSystem
) {
if ( ! geometry.__webglVertexBuffer
) {
if ( ! geometry.__webglVertexBuffer ) {
createParticleBuffers( geometry );
initParticleBuffers( geometry, object );
createParticleBuffers( geometry )
;
initParticleBuffers( geometry, object )
;
geometry.verticesNeedUpdate = true
;
geometry.colorsNeedUpdate = true
;
geometry.verticesNeedUpdate = true;
geometry.colorsNeedUpdate = true;
}
}
...
...
@@ -24054,7 +24044,6 @@ THREE.WebGLRenderer = function ( parameters ) {
id: null,
buffer: buffer,
object: object,
materialId: null,
opaque: null,
transparent: null,
z: 0
...
...
build/three.min.js
浏览文件 @
2401418c
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录