Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
df33501d
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,发现更多精彩内容 >>
提交
df33501d
编写于
11月 25, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
dbb5aac0
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
109 addition
and
71 deletion
+109
-71
build/three.js
build/three.js
+78
-38
build/three.min.js
build/three.min.js
+31
-33
未找到文件。
build/three.js
浏览文件 @
df33501d
...
...
@@ -1965,19 +1965,42 @@ THREE.Vector3.prototype = {
getPositionFromMatrix: function ( m ) {
this.x = m.elements[12];
this.y = m.elements[13];
this.z = m.elements[14];
console.warn( "DEPRECATED: Vector3\'s .getPositionFromMatrix() has been renamed to .setFromMatrixPosition(). Please update your code." );
return this;
return this
.setFromMatrixPosition( m )
;
},
getScaleFromMatrix: function ( m ) {
var sx = this.set( m.elements[0], m.elements[1], m.elements[2] ).length();
var sy = this.set( m.elements[4], m.elements[5], m.elements[6] ).length();
var sz = this.set( m.elements[8], m.elements[9], m.elements[10] ).length();
console.warn( "DEPRECATED: Vector3\'s .getScaleFromMatrix() has been renamed to .setFromMatrixScale(). Please update your code." );
return this.setFromMatrixScale( m );
},
getColumnFromMatrix: function ( index, matrix ) {
console.warn( "DEPRECATED: Vector3\'s .getColumnFromMatrix() has been renamed to .setFromMatrixColumn(). Please update your code." );
return this.setFromMatrixColumn( index, matrix );
},
setFromMatrixPosition: function ( m ) {
this.x = m.elements[ 12 ];
this.y = m.elements[ 13 ];
this.z = m.elements[ 14 ];
return this;
},
setFromMatrixScale: function ( m ) {
var sx = this.set( m.elements[ 0 ], m.elements[ 1 ], m.elements[ 2 ] ).length();
var sy = this.set( m.elements[ 4 ], m.elements[ 5 ], m.elements[ 6 ] ).length();
var sz = this.set( m.elements[ 8 ], m.elements[ 9 ], m.elements[ 10 ] ).length();
this.x = sx;
this.y = sy;
...
...
@@ -1986,7 +2009,7 @@ THREE.Vector3.prototype = {
return this;
},
getColumnFromMatrix
: function ( index, matrix ) {
setFromMatrixColumn
: function ( index, matrix ) {
var offset = index * 4;
...
...
@@ -4627,7 +4650,7 @@ THREE.Matrix4.prototype = {
return function () {
console.warn( 'DEPRECATED: Matrix4\'s .getPosition() has been removed. Use Vector3.
getPositionFromMatrix
( matrix ) instead.' );
console.warn( 'DEPRECATED: Matrix4\'s .getPosition() has been removed. Use Vector3.
setFromMatrixPosition
( matrix ) instead.' );
var te = this.elements;
return v1.set( te[12], te[13], te[14] );
...
...
@@ -6806,7 +6829,7 @@ THREE.EventDispatcher.prototype = {
if ( object instanceof THREE.Sprite ) {
matrixPosition.
getPositionFromMatrix
( object.matrixWorld );
matrixPosition.
setFromMatrixPosition
( object.matrixWorld );
var distance = raycaster.ray.distanceToPoint( matrixPosition );
if ( distance > object.scale.x ) {
...
...
@@ -6826,7 +6849,7 @@ THREE.EventDispatcher.prototype = {
} else if ( object instanceof THREE.LOD ) {
matrixPosition.
getPositionFromMatrix
( object.matrixWorld );
matrixPosition.
setFromMatrixPosition
( object.matrixWorld );
var distance = raycaster.ray.origin.distanceTo( matrixPosition );
intersectObject( object.getObjectForDistance( distance ), raycaster, intersects );
...
...
@@ -7305,9 +7328,9 @@ THREE.Object3D.prototype = {
this.matrix.multiplyMatrices( matrix, this.matrix );
this.position.
getPositionFromMatrix
( this.matrix );
this.position.
setFromMatrixPosition
( this.matrix );
this.scale.
getScaleFromMatrix
( this.matrix );
this.scale.
setFromMatrixScale
( this.matrix );
m1.extractRotation( this.matrix );
...
...
@@ -7849,7 +7872,7 @@ THREE.Projector = function () {
} else {
_vector3.
getPositionFromMatrix
( object.matrixWorld );
_vector3.
setFromMatrixPosition
( object.matrixWorld );
_vector3.applyProjection( _viewProjectionMatrix );
_object.z = _vector3.z;
...
...
@@ -15055,8 +15078,8 @@ THREE.LOD.prototype.update = function () {
if ( this.objects.length > 1 ) {
v1.
getPositionFromMatrix
( camera.matrixWorld );
v2.
getPositionFromMatrix
( this.matrixWorld );
v1.
setFromMatrixPosition
( camera.matrixWorld );
v2.
setFromMatrixPosition
( this.matrixWorld );
var distance = v1.distanceTo( v2 );
...
...
@@ -15722,7 +15745,7 @@ THREE.CanvasRenderer = function ( parameters ) {
if ( light instanceof THREE.DirectionalLight ) {
var lightPosition = _vector3.
getPositionFromMatrix
( light.matrixWorld ).normalize();
var lightPosition = _vector3.
setFromMatrixPosition
( light.matrixWorld ).normalize();
var amount = normal.dot( lightPosition );
...
...
@@ -15734,7 +15757,7 @@ THREE.CanvasRenderer = function ( parameters ) {
} else if ( light instanceof THREE.PointLight ) {
var lightPosition = _vector3.
getPositionFromMatrix
( light.matrixWorld );
var lightPosition = _vector3.
setFromMatrixPosition
( light.matrixWorld );
var amount = normal.dot( _vector3.subVectors( lightPosition, position ).normalize() );
...
...
@@ -15762,8 +15785,9 @@ THREE.CanvasRenderer = function ( parameters ) {
var scaleX = element.scale.x * _canvasWidthHalf;
var scaleY = element.scale.y * _canvasHeightHalf;
_elemBox.min.set( v1.x - ( scaleX * 0.5 ), v1.y - ( scaleY * 0.5 ) );
_elemBox.max.set( v1.x + ( scaleX * 0.5 ), v1.y + ( scaleY * 0.5 ) );
var dist = 0.5 * Math.sqrt( scaleX * scaleX + scaleY * scaleY ); // allow for rotated sprite
_elemBox.min.set( v1.x - dist, v1.y - dist );
_elemBox.max.set( v1.x + dist, v1.y + dist );
if ( _clipBox.isIntersectionBox( _elemBox ) === false ) {
...
...
@@ -15781,7 +15805,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_context.save();
_context.translate( v1.x, v1.y );
_context.rotate(
-
material.rotation );
_context.rotate( material.rotation );
_context.scale( scaleX, - scaleY );
_context.drawImage( bitmap, 0, 0, bitmap.width, bitmap.height, - 0.5, - 0.5, 1, 1 );
...
...
@@ -15793,8 +15817,8 @@ THREE.CanvasRenderer = function ( parameters ) {
_context.save();
_context.translate( v1.x, v1.y );
_context.rotate(
- element
.rotation );
_context.scale( scaleX, scaleY );
_context.rotate(
material
.rotation );
_context.scale( scaleX,
-
scaleY );
_context.fillRect( - 0.5, - 0.5, 1, 1 );
_context.restore();
...
...
@@ -16384,6 +16408,8 @@ THREE.CanvasRenderer = function ( parameters ) {
};
/**
* Shader chunks for WebLG Shader library
*
* @author alteredq / http://alteredqualia.com/
* @author mrdoob / http://mrdoob.com/
* @author mikael emtinger / http://gomo.se/
...
...
@@ -18157,6 +18183,9 @@ THREE.ShaderChunk = {
};
/**
* Uniform Utilities
*/
THREE.UniformsUtils = {
...
...
@@ -18220,6 +18249,9 @@ THREE.UniformsUtils = {
}
};
/**
* Uniforms library for shared webgl shaders
*/
THREE.UniformsLib = {
...
...
@@ -18319,6 +18351,14 @@ THREE.UniformsLib = {
}
};
/**
* Webgl Shader Library for three.js
*
* @author alteredq / http://alteredqualia.com/
* @author mrdoob / http://mrdoob.com/
* @author mikael emtinger / http://gomo.se/
*/
THREE.ShaderLib = {
...
...
@@ -22875,7 +22915,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else {
_vector3.
getPositionFromMatrix
( object.matrixWorld );
_vector3.
setFromMatrixPosition
( object.matrixWorld );
_vector3.applyProjection( _projScreenMatrix );
webglObject.z = _vector3.z;
...
...
@@ -24003,7 +24043,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( p_uniforms.cameraPosition !== null ) {
_vector3.
getPositionFromMatrix
( camera.matrixWorld );
_vector3.
setFromMatrixPosition
( camera.matrixWorld );
_gl.uniform3f( p_uniforms.cameraPosition, _vector3.x, _vector3.y, _vector3.z );
}
...
...
@@ -24607,8 +24647,8 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( ! light.visible ) continue;
_direction.
getPositionFromMatrix
( light.matrixWorld );
_vector3.
getPositionFromMatrix
( light.target.matrixWorld );
_direction.
setFromMatrixPosition
( light.matrixWorld );
_vector3.
setFromMatrixPosition
( light.target.matrixWorld );
_direction.sub( _vector3 );
_direction.normalize();
...
...
@@ -24653,7 +24693,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_vector3.
getPositionFromMatrix
( light.matrixWorld );
_vector3.
setFromMatrixPosition
( light.matrixWorld );
pointPositions[ pointOffset ] = _vector3.x;
pointPositions[ pointOffset + 1 ] = _vector3.y;
...
...
@@ -24681,7 +24721,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_vector3.
getPositionFromMatrix
( light.matrixWorld );
_vector3.
setFromMatrixPosition
( light.matrixWorld );
spotPositions[ spotOffset ] = _vector3.x;
spotPositions[ spotOffset + 1 ] = _vector3.y;
...
...
@@ -24690,7 +24730,7 @@ THREE.WebGLRenderer = function ( parameters ) {
spotDistances[ spotLength ] = distance;
_direction.copy( _vector3 );
_vector3.
getPositionFromMatrix
( light.target.matrixWorld );
_vector3.
setFromMatrixPosition
( light.target.matrixWorld );
_direction.sub( _vector3 );
_direction.normalize();
...
...
@@ -24709,7 +24749,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( ! light.visible ) continue;
_direction.
getPositionFromMatrix
( light.matrixWorld );
_direction.
setFromMatrixPosition
( light.matrixWorld );
_direction.normalize();
// skip lights with undefined direction
...
...
@@ -34405,8 +34445,8 @@ THREE.DirectionalLightHelper.prototype.update = function () {
return function () {
v1.
getPositionFromMatrix
( this.light.matrixWorld );
v2.
getPositionFromMatrix
( this.light.target.matrixWorld );
v1.
setFromMatrixPosition
( this.light.matrixWorld );
v2.
setFromMatrixPosition
( this.light.target.matrixWorld );
v3.subVectors( v2, v1 );
this.lightPlane.lookAt( v3 );
...
...
@@ -34589,7 +34629,7 @@ THREE.HemisphereLightHelper.prototype.update = function () {
this.colors[ 0 ].copy( this.light.color ).multiplyScalar( this.light.intensity );
this.colors[ 1 ].copy( this.light.groundColor ).multiplyScalar( this.light.intensity );
this.lightSphere.lookAt( vector.
getPositionFromMatrix
( this.light.matrixWorld ).negate() );
this.lightSphere.lookAt( vector.
setFromMatrixPosition
( this.light.matrixWorld ).negate() );
this.lightSphere.geometry.colorsNeedUpdate = true;
}
...
...
@@ -34719,8 +34759,8 @@ THREE.SpotLightHelper.prototype.update = function () {
this.cone.scale.set( coneWidth, coneWidth, coneLength );
vector.
getPositionFromMatrix
( this.light.matrixWorld );
vector2.
getPositionFromMatrix
( this.light.target.matrixWorld );
vector.
setFromMatrixPosition
( this.light.matrixWorld );
vector2.
setFromMatrixPosition
( this.light.target.matrixWorld );
this.cone.lookAt( vector2.sub( vector ) );
...
...
@@ -35893,8 +35933,8 @@ THREE.ShadowMapPlugin = function () {
shadowMatrix = light.shadowMatrix;
shadowCamera = light.shadowCamera;
shadowCamera.position.
getPositionFromMatrix
( light.matrixWorld );
_matrixPosition.
getPositionFromMatrix
( light.target.matrixWorld );
shadowCamera.position.
setFromMatrixPosition
( light.matrixWorld );
_matrixPosition.
setFromMatrixPosition
( light.target.matrixWorld );
shadowCamera.lookAt( _matrixPosition );
shadowCamera.updateMatrixWorld();
...
...
build/three.min.js
浏览文件 @
df33501d
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录