提交 90bd8e03 编写于 作者: M Mr.doob

Updated builds.

上级 14a98f92
...@@ -1561,6 +1561,19 @@ THREE.Vector2.prototype = { ...@@ -1561,6 +1561,19 @@ THREE.Vector2.prototype = {
}, },
fromAttribute: function ( attribute, index, offset ) {
if ( offset === undefined ) offset = 0;
index = index * attribute.itemSize + offset;
this.x = attribute.array[ index ];
this.y = attribute.array[ index + 1 ];
return this;
},
clone: function () { clone: function () {
return new THREE.Vector2( this.x, this.y ); return new THREE.Vector2( this.x, this.y );
...@@ -2382,6 +2395,20 @@ THREE.Vector3.prototype = { ...@@ -2382,6 +2395,20 @@ THREE.Vector3.prototype = {
}, },
fromAttribute: function ( attribute, index, offset ) {
if ( offset === undefined ) offset = 0;
index = index * attribute.itemSize + offset;
this.x = attribute.array[ index ];
this.y = attribute.array[ index + 1 ];
this.z = attribute.array[ index + 2 ];
return this;
},
clone: function () { clone: function () {
return new THREE.Vector3( this.x, this.y, this.z ); return new THREE.Vector3( this.x, this.y, this.z );
...@@ -3042,6 +3069,21 @@ THREE.Vector4.prototype = { ...@@ -3042,6 +3069,21 @@ THREE.Vector4.prototype = {
}, },
fromAttribute: function ( attribute, index, offset ) {
if ( offset === undefined ) offset = 0;
index = index * attribute.itemSize + offset;
this.x = attribute.array[ index ];
this.y = attribute.array[ index + 1 ];
this.z = attribute.array[ index + 2 ];
this.w = attribute.array[ index + 3 ];
return this;
},
clone: function () { clone: function () {
return new THREE.Vector4( this.x, this.y, this.z, this.w ); return new THREE.Vector4( this.x, this.y, this.z, this.w );
...@@ -13993,6 +14035,7 @@ THREE.MeshFaceMaterial.prototype = { ...@@ -13993,6 +14035,7 @@ THREE.MeshFaceMaterial.prototype = {
* map: new THREE.Texture( <Image> ), * map: new THREE.Texture( <Image> ),
* *
* size: <float>, * size: <float>,
* sizeAttenuation: <bool>,
* *
* blending: THREE.NormalBlending, * blending: THREE.NormalBlending,
* depthTest: <bool>, * depthTest: <bool>,
...@@ -17976,6 +18019,8 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -17976,6 +18019,8 @@ THREE.WebGLRenderer = function ( parameters ) {
var _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElement( 'canvas' ), var _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElement( 'canvas' ),
_context = parameters.context !== undefined ? parameters.context : null, _context = parameters.context !== undefined ? parameters.context : null,
pixelRatio = 1,
_precision = parameters.precision !== undefined ? parameters.precision : 'highp', _precision = parameters.precision !== undefined ? parameters.precision : 'highp',
_alpha = parameters.alpha !== undefined ? parameters.alpha : false, _alpha = parameters.alpha !== undefined ? parameters.alpha : false,
...@@ -18004,7 +18049,6 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -18004,7 +18049,6 @@ THREE.WebGLRenderer = function ( parameters ) {
this.domElement = _canvas; this.domElement = _canvas;
this.context = null; this.context = null;
this.devicePixelRatio = self.devicePixelRatio !== undefined ? self.devicePixelRatio : 1;
// clearing // clearing
...@@ -18426,10 +18470,22 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -18426,10 +18470,22 @@ THREE.WebGLRenderer = function ( parameters ) {
}; };
this.getPixelRatio = function () {
return pixelRatio;
};
this.setPixelRatio = function ( value ) {
pixelRatio = value;
};
this.setSize = function ( width, height, updateStyle ) { this.setSize = function ( width, height, updateStyle ) {
_canvas.width = width * this.devicePixelRatio; _canvas.width = width * pixelRatio;
_canvas.height = height * this.devicePixelRatio; _canvas.height = height * pixelRatio;
if ( updateStyle !== false ) { if ( updateStyle !== false ) {
...@@ -18444,11 +18500,11 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -18444,11 +18500,11 @@ THREE.WebGLRenderer = function ( parameters ) {
this.setViewport = function ( x, y, width, height ) { this.setViewport = function ( x, y, width, height ) {
_viewportX = x * this.devicePixelRatio; _viewportX = x * pixelRatio;
_viewportY = y * this.devicePixelRatio; _viewportY = y * pixelRatio;
_viewportWidth = width * this.devicePixelRatio; _viewportWidth = width * pixelRatio;
_viewportHeight = height * this.devicePixelRatio; _viewportHeight = height * pixelRatio;
_gl.viewport( _viewportX, _viewportY, _viewportWidth, _viewportHeight ); _gl.viewport( _viewportX, _viewportY, _viewportWidth, _viewportHeight );
...@@ -18457,10 +18513,10 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -18457,10 +18513,10 @@ THREE.WebGLRenderer = function ( parameters ) {
this.setScissor = function ( x, y, width, height ) { this.setScissor = function ( x, y, width, height ) {
_gl.scissor( _gl.scissor(
x * this.devicePixelRatio, x * pixelRatio,
y * this.devicePixelRatio, y * pixelRatio,
width * this.devicePixelRatio, width * pixelRatio,
height * this.devicePixelRatio height * pixelRatio
); );
}; };
...@@ -27212,7 +27268,7 @@ THREE.AudioListener.prototype.updateMatrixWorld = ( function () { ...@@ -27212,7 +27268,7 @@ THREE.AudioListener.prototype.updateMatrixWorld = ( function () {
var listener = this.context.listener; var listener = this.context.listener;
var up = this.up; var up = this.up;
this.matrixWorld.decompose( position, quaternion, scale ); this.matrixWorld.decompose( position, quaternion, scale );
orientation.set( 0, 0, -1 ).applyQuaternion( quaternion ); orientation.set( 0, 0, -1 ).applyQuaternion( quaternion );
...@@ -29894,8 +29950,6 @@ THREE.Animation.prototype.reset = function () { ...@@ -29894,8 +29950,6 @@ THREE.Animation.prototype.reset = function () {
var object = this.hierarchy[ h ]; var object = this.hierarchy[ h ];
object.matrixAutoUpdate = true;
if ( object.animationCache === undefined ) { if ( object.animationCache === undefined ) {
object.animationCache = { object.animationCache = {
...@@ -30038,7 +30092,6 @@ THREE.Animation.prototype.update = (function(){ ...@@ -30038,7 +30092,6 @@ THREE.Animation.prototype.update = (function(){
} else { } else {
this.stop(); this.stop();
return;
} }
...@@ -30078,9 +30131,6 @@ THREE.Animation.prototype.update = (function(){ ...@@ -30078,9 +30131,6 @@ THREE.Animation.prototype.update = (function(){
} }
object.matrixAutoUpdate = true;
object.matrixWorldNeedsUpdate = true;
var scale = ( this.currentTime - prevKey.time ) / ( nextKey.time - prevKey.time ); var scale = ( this.currentTime - prevKey.time ) / ( nextKey.time - prevKey.time );
var prevXYZ = prevKey[ type ]; var prevXYZ = prevKey[ type ];
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册