Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
28894ccb
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 搜索 >>
提交
28894ccb
编写于
3月 14, 2018
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
r91
上级
935739be
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
769 addition
and
637 deletion
+769
-637
.github/ISSUE_TEMPLATE.md
.github/ISSUE_TEMPLATE.md
+1
-1
build/three.js
build/three.js
+111
-46
build/three.min.js
build/three.min.js
+544
-542
build/three.module.js
build/three.module.js
+111
-46
package.json
package.json
+1
-1
src/constants.js
src/constants.js
+1
-1
未找到文件。
.github/ISSUE_TEMPLATE.md
浏览文件 @
28894ccb
...
...
@@ -19,7 +19,7 @@ Please also include a live example if possible. You can start from these templat
##### Three.js version
-
[ ] Dev
-
[ ] r9
0
-
[ ] r9
1
-
[ ] ...
##### Browser
...
...
build/three.js
浏览文件 @
28894ccb
...
...
@@ -185,7 +185,7 @@
} );
var REVISION = '91
dev
';
var REVISION = '91';
var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
var CullFaceNone = 0;
var CullFaceBack = 1;
...
...
@@ -13749,15 +13749,15 @@
Object.assign( Triangle, {
n
ormal: function () {
getN
ormal: function () {
var v0 = new Vector3();
return function
n
ormal( a, b, c, target ) {
return function
getN
ormal( a, b, c, target ) {
if ( target === undefined ) {
console.warn( 'THREE.Triangle: .
n
ormal() target is now required' );
console.warn( 'THREE.Triangle: .
getN
ormal() target is now required' );
target = new Vector3();
}
...
...
@@ -13781,13 +13781,13 @@
// static/instance method to calculate barycentric coordinates
// based on: http://www.blackpawn.com/texts/pointinpoly/default.html
barycoordFromPoint
: function () {
getBarycoord
: function () {
var v0 = new Vector3();
var v1 = new Vector3();
var v2 = new Vector3();
return function
barycoordFromPoint
( point, a, b, c, target ) {
return function
getBarycoord
( point, a, b, c, target ) {
v0.subVectors( c, a );
v1.subVectors( b, a );
...
...
@@ -13803,7 +13803,7 @@
if ( target === undefined ) {
console.warn( 'THREE.Triangle: .
barycoordFromPoint
() target is now required' );
console.warn( 'THREE.Triangle: .
getBarycoord
() target is now required' );
target = new Vector3();
}
...
...
@@ -13834,7 +13834,7 @@
return function containsPoint( point, a, b, c ) {
Triangle.
barycoordFromPoint
( point, a, b, c, v1 );
Triangle.
getBarycoord
( point, a, b, c, v1 );
return ( v1.x >= 0 ) && ( v1.y >= 0 ) && ( ( v1.x + v1.y ) <= 1 );
...
...
@@ -13882,12 +13882,12 @@
},
a
rea: function () {
getA
rea: function () {
var v0 = new Vector3();
var v1 = new Vector3();
return function
a
rea() {
return function
getA
rea() {
v0.subVectors( this.c, this.b );
v1.subVectors( this.a, this.b );
...
...
@@ -13898,11 +13898,11 @@
}(),
m
idpoint: function ( target ) {
getM
idpoint: function ( target ) {
if ( target === undefined ) {
console.warn( 'THREE.Triangle: .
m
idpoint() target is now required' );
console.warn( 'THREE.Triangle: .
getM
idpoint() target is now required' );
target = new Vector3();
}
...
...
@@ -13911,17 +13911,17 @@
},
n
ormal: function ( target ) {
getN
ormal: function ( target ) {
return Triangle.
n
ormal( this.a, this.b, this.c, target );
return Triangle.
getN
ormal( this.a, this.b, this.c, target );
},
p
lane: function ( target ) {
getP
lane: function ( target ) {
if ( target === undefined ) {
console.warn( 'THREE.Triangle: .
p
lane() target is now required' );
console.warn( 'THREE.Triangle: .
getP
lane() target is now required' );
target = new Vector3();
}
...
...
@@ -13930,9 +13930,9 @@
},
barycoordFromPoint
: function ( point, target ) {
getBarycoord
: function ( point, target ) {
return Triangle.
barycoordFromPoint
( point, this.a, this.b, this.c, target );
return Triangle.
getBarycoord
( point, this.a, this.b, this.c, target );
},
...
...
@@ -14156,7 +14156,7 @@
function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) {
Triangle.
barycoordFromPoint
( point, p1, p2, p3, barycoord );
Triangle.
getBarycoord
( point, p1, p2, p3, barycoord );
uv1.multiplyScalar( barycoord.x );
uv2.multiplyScalar( barycoord.y );
...
...
@@ -14220,7 +14220,7 @@
}
var face = new Face3( a, b, c );
Triangle.
n
ormal( vA, vB, vC, face.normal );
Triangle.
getN
ormal( vA, vB, vC, face.normal );
intersection.face = face;
intersection.faceIndex = a;
...
...
@@ -19644,7 +19644,7 @@
function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {
var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
/* global WebGL2RenderingContext */
var _videoTextures = {};
var _canvas;
...
...
@@ -19654,6 +19654,13 @@
if ( image.width > maxSize || image.height > maxSize ) {
if ( 'data' in image ) {
console.warn( 'THREE.WebGLRenderer: image in DataTexture is too big (' + image.width + 'x' + image.height + ').' );
return;
}
// Warning: Scaling through the canvas will only work with images that use
// premultiplied alpha.
...
...
@@ -20929,6 +20936,8 @@
}
var matrixWorldInverse = new Matrix4();
var tempQuaternion = new Quaternion();
var tempPosition = new Vector3();
var cameraL = new PerspectiveCamera();
cameraL.bounds = new Vector4( 0.0, 0.0, 0.5, 1.0 );
...
...
@@ -21007,38 +21016,42 @@
//
var pose = frameData.pose;
var poseObject = poseTarget !== null ? poseTarget : camera;
var stageParameters = device.stageParameters;
if (
pose.position !== null
) {
if (
stageParameters
) {
poseObject.position.fromArray( pose.position
);
standingMatrix.fromArray( stageParameters.sittingToStandingTransform
);
} else {
poseObject.position.set( 0, 0
, 0 );
standingMatrix.makeTranslation( 0, scope.userHeight
, 0 );
}
if ( pose.orientation !== null ) {
poseObject.quaternion.fromArray( pose.orientation );
var pose = frameData.pose;
var poseObject = poseTarget !== null ? poseTarget : camera;
}
// We want to manipulate poseObject by its position and quaternion components since users may rely on them.
poseObject.matrix.copy( standingMatrix );
poseObject.matrix.decompose( poseObject.position, poseObject.quaternion, poseObject.scale );
var stageParameters = device.stageParameters;
if ( pose.orientation !== null ) {
if ( stageParameters ) {
tempQuaternion.fromArray( pose.orientation );
poseObject.quaternion.multiply( tempQuaternion );
standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
}
} else
{
if ( pose.position !== null )
{
standingMatrix.makeTranslation( 0, scope.userHeight, 0 );
tempQuaternion.setFromRotationMatrix( standingMatrix );
tempPosition.fromArray( pose.position );
tempPosition.applyQuaternion( tempQuaternion );
poseObject.position.add( tempPosition );
}
poseObject.position.applyMatrix4( standingMatrix );
poseObject.updateMatrixWorld();
if ( device.isPresenting === false ) return camera;
...
...
@@ -25441,7 +25454,7 @@
// vertex
p0 =
func( u, v, p0 );
func( u, v, p0 );
vertices.push( p0.x, p0.y, p0.z );
// normal
...
...
@@ -25450,24 +25463,24 @@
if ( u - EPS >= 0 ) {
p1 =
func( u - EPS, v, p1 );
func( u - EPS, v, p1 );
pu.subVectors( p0, p1 );
} else {
p1 =
func( u + EPS, v, p1 );
func( u + EPS, v, p1 );
pu.subVectors( p1, p0 );
}
if ( v - EPS >= 0 ) {
p1 =
func( u, v - EPS, p1 );
func( u, v - EPS, p1 );
pv.subVectors( p0, p1 );
} else {
p1 =
func( u, v + EPS, p1 );
func( u, v + EPS, p1 );
pv.subVectors( p1, p0 );
}
...
...
@@ -28148,7 +28161,7 @@
}
scope.addGroup( start, verticesArray.length / 3 - start,
options.material !== undefined ? options.material :
0 );
scope.addGroup( start, verticesArray.length / 3 - start, 0 );
}
...
...
@@ -28172,7 +28185,7 @@
}
scope.addGroup( start, verticesArray.length / 3 - start,
options.extrudeMaterial !== undefined ? options.extrudeMaterial :
1 );
scope.addGroup( start, verticesArray.length / 3 - start, 1 );
}
...
...
@@ -42123,9 +42136,9 @@
},
intersectObject: function ( object, recursive ) {
intersectObject: function ( object, recursive
, optionalTarget
) {
var intersects = [];
var intersects =
optionalTarget ||
[];
intersectObject( object, this, intersects, recursive );
...
...
@@ -42135,9 +42148,9 @@
},
intersectObjects: function ( objects, recursive ) {
intersectObjects: function ( objects, recursive
, optionalTarget
) {
var intersects = [];
var intersects =
optionalTarget ||
[];
if ( Array.isArray( objects ) === false ) {
...
...
@@ -44731,6 +44744,58 @@
} );
Object.assign( Triangle.prototype, {
area: function () {
console.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' );
return this.getArea();
},
barycoordFromPoint: function ( point, target ) {
console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
return this.getBarycoord( point, target );
},
midpoint: function ( target ) {
console.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' );
return this.getMidpoint( target );
},
normal: function ( target ) {
console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
return this.getNormal( target );
},
plane: function ( target ) {
console.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' );
return this.getPlane( target );
}
} );
Object.assign( Triangle, {
barycoordFromPoint: function ( point, a, b, c, target ) {
console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
return Triangle.getBarycoord( point, a, b, c, target );
},
normal: function ( a, b, c, target ) {
console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
return Triangle.getNormal( a, b, c, target );
}
} );
Object.assign( Shape.prototype, {
extractAllPoints: function ( divisions ) {
build/three.min.js
浏览文件 @
28894ccb
此差异已折叠。
点击以展开。
build/three.module.js
浏览文件 @
28894ccb
...
...
@@ -179,7 +179,7 @@ Object.assign( EventDispatcher.prototype, {
} );
var REVISION = '91
dev
';
var REVISION = '91';
var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
var CullFaceNone = 0;
var CullFaceBack = 1;
...
...
@@ -13743,15 +13743,15 @@ function Triangle( a, b, c ) {
Object.assign( Triangle, {
n
ormal: function () {
getN
ormal: function () {
var v0 = new Vector3();
return function
n
ormal( a, b, c, target ) {
return function
getN
ormal( a, b, c, target ) {
if ( target === undefined ) {
console.warn( 'THREE.Triangle: .
n
ormal() target is now required' );
console.warn( 'THREE.Triangle: .
getN
ormal() target is now required' );
target = new Vector3();
}
...
...
@@ -13775,13 +13775,13 @@ Object.assign( Triangle, {
// static/instance method to calculate barycentric coordinates
// based on: http://www.blackpawn.com/texts/pointinpoly/default.html
barycoordFromPoint
: function () {
getBarycoord
: function () {
var v0 = new Vector3();
var v1 = new Vector3();
var v2 = new Vector3();
return function
barycoordFromPoint
( point, a, b, c, target ) {
return function
getBarycoord
( point, a, b, c, target ) {
v0.subVectors( c, a );
v1.subVectors( b, a );
...
...
@@ -13797,7 +13797,7 @@ Object.assign( Triangle, {
if ( target === undefined ) {
console.warn( 'THREE.Triangle: .
barycoordFromPoint
() target is now required' );
console.warn( 'THREE.Triangle: .
getBarycoord
() target is now required' );
target = new Vector3();
}
...
...
@@ -13828,7 +13828,7 @@ Object.assign( Triangle, {
return function containsPoint( point, a, b, c ) {
Triangle.
barycoordFromPoint
( point, a, b, c, v1 );
Triangle.
getBarycoord
( point, a, b, c, v1 );
return ( v1.x >= 0 ) && ( v1.y >= 0 ) && ( ( v1.x + v1.y ) <= 1 );
...
...
@@ -13876,12 +13876,12 @@ Object.assign( Triangle.prototype, {
},
a
rea: function () {
getA
rea: function () {
var v0 = new Vector3();
var v1 = new Vector3();
return function
a
rea() {
return function
getA
rea() {
v0.subVectors( this.c, this.b );
v1.subVectors( this.a, this.b );
...
...
@@ -13892,11 +13892,11 @@ Object.assign( Triangle.prototype, {
}(),
m
idpoint: function ( target ) {
getM
idpoint: function ( target ) {
if ( target === undefined ) {
console.warn( 'THREE.Triangle: .
m
idpoint() target is now required' );
console.warn( 'THREE.Triangle: .
getM
idpoint() target is now required' );
target = new Vector3();
}
...
...
@@ -13905,17 +13905,17 @@ Object.assign( Triangle.prototype, {
},
n
ormal: function ( target ) {
getN
ormal: function ( target ) {
return Triangle.
n
ormal( this.a, this.b, this.c, target );
return Triangle.
getN
ormal( this.a, this.b, this.c, target );
},
p
lane: function ( target ) {
getP
lane: function ( target ) {
if ( target === undefined ) {
console.warn( 'THREE.Triangle: .
p
lane() target is now required' );
console.warn( 'THREE.Triangle: .
getP
lane() target is now required' );
target = new Vector3();
}
...
...
@@ -13924,9 +13924,9 @@ Object.assign( Triangle.prototype, {
},
barycoordFromPoint
: function ( point, target ) {
getBarycoord
: function ( point, target ) {
return Triangle.
barycoordFromPoint
( point, this.a, this.b, this.c, target );
return Triangle.
getBarycoord
( point, this.a, this.b, this.c, target );
},
...
...
@@ -14150,7 +14150,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) {
Triangle.
barycoordFromPoint
( point, p1, p2, p3, barycoord );
Triangle.
getBarycoord
( point, p1, p2, p3, barycoord );
uv1.multiplyScalar( barycoord.x );
uv2.multiplyScalar( barycoord.y );
...
...
@@ -14214,7 +14214,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
}
var face = new Face3( a, b, c );
Triangle.
n
ormal( vA, vB, vC, face.normal );
Triangle.
getN
ormal( vA, vB, vC, face.normal );
intersection.face = face;
intersection.faceIndex = a;
...
...
@@ -19638,7 +19638,7 @@ function WebGLState( gl, extensions, utils ) {
function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {
var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
/* global WebGL2RenderingContext */
var _videoTextures = {};
var _canvas;
...
...
@@ -19648,6 +19648,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if ( image.width > maxSize || image.height > maxSize ) {
if ( 'data' in image ) {
console.warn( 'THREE.WebGLRenderer: image in DataTexture is too big (' + image.width + 'x' + image.height + ').' );
return;
}
// Warning: Scaling through the canvas will only work with images that use
// premultiplied alpha.
...
...
@@ -20923,6 +20930,8 @@ function WebVRManager( renderer ) {
}
var matrixWorldInverse = new Matrix4();
var tempQuaternion = new Quaternion();
var tempPosition = new Vector3();
var cameraL = new PerspectiveCamera();
cameraL.bounds = new Vector4( 0.0, 0.0, 0.5, 1.0 );
...
...
@@ -21001,38 +21010,42 @@ function WebVRManager( renderer ) {
//
var pose = frameData.pose;
var poseObject = poseTarget !== null ? poseTarget : camera;
var stageParameters = device.stageParameters;
if (
pose.position !== null
) {
if (
stageParameters
) {
poseObject.position.fromArray( pose.position
);
standingMatrix.fromArray( stageParameters.sittingToStandingTransform
);
} else {
poseObject.position.set( 0, 0
, 0 );
standingMatrix.makeTranslation( 0, scope.userHeight
, 0 );
}
if ( pose.orientation !== null ) {
poseObject.quaternion.fromArray( pose.orientation );
var pose = frameData.pose;
var poseObject = poseTarget !== null ? poseTarget : camera;
}
// We want to manipulate poseObject by its position and quaternion components since users may rely on them.
poseObject.matrix.copy( standingMatrix );
poseObject.matrix.decompose( poseObject.position, poseObject.quaternion, poseObject.scale );
var stageParameters = device.stageParameters;
if ( pose.orientation !== null ) {
if ( stageParameters ) {
tempQuaternion.fromArray( pose.orientation );
poseObject.quaternion.multiply( tempQuaternion );
standingMatrix.fromArray( stageParameters.sittingToStandingTransform );
}
} else
{
if ( pose.position !== null )
{
standingMatrix.makeTranslation( 0, scope.userHeight, 0 );
tempQuaternion.setFromRotationMatrix( standingMatrix );
tempPosition.fromArray( pose.position );
tempPosition.applyQuaternion( tempQuaternion );
poseObject.position.add( tempPosition );
}
poseObject.position.applyMatrix4( standingMatrix );
poseObject.updateMatrixWorld();
if ( device.isPresenting === false ) return camera;
...
...
@@ -25435,7 +25448,7 @@ function ParametricBufferGeometry( func, slices, stacks ) {
// vertex
p0 =
func( u, v, p0 );
func( u, v, p0 );
vertices.push( p0.x, p0.y, p0.z );
// normal
...
...
@@ -25444,24 +25457,24 @@ function ParametricBufferGeometry( func, slices, stacks ) {
if ( u - EPS >= 0 ) {
p1 =
func( u - EPS, v, p1 );
func( u - EPS, v, p1 );
pu.subVectors( p0, p1 );
} else {
p1 =
func( u + EPS, v, p1 );
func( u + EPS, v, p1 );
pu.subVectors( p1, p0 );
}
if ( v - EPS >= 0 ) {
p1 =
func( u, v - EPS, p1 );
func( u, v - EPS, p1 );
pv.subVectors( p0, p1 );
} else {
p1 =
func( u, v + EPS, p1 );
func( u, v + EPS, p1 );
pv.subVectors( p1, p0 );
}
...
...
@@ -28142,7 +28155,7 @@ ExtrudeBufferGeometry.prototype.addShape = function ( shape, options ) {
}
scope.addGroup( start, verticesArray.length / 3 - start,
options.material !== undefined ? options.material :
0 );
scope.addGroup( start, verticesArray.length / 3 - start, 0 );
}
...
...
@@ -28166,7 +28179,7 @@ ExtrudeBufferGeometry.prototype.addShape = function ( shape, options ) {
}
scope.addGroup( start, verticesArray.length / 3 - start,
options.extrudeMaterial !== undefined ? options.extrudeMaterial :
1 );
scope.addGroup( start, verticesArray.length / 3 - start, 1 );
}
...
...
@@ -42117,9 +42130,9 @@ Object.assign( Raycaster.prototype, {
},
intersectObject: function ( object, recursive ) {
intersectObject: function ( object, recursive
, optionalTarget
) {
var intersects = [];
var intersects =
optionalTarget ||
[];
intersectObject( object, this, intersects, recursive );
...
...
@@ -42129,9 +42142,9 @@ Object.assign( Raycaster.prototype, {
},
intersectObjects: function ( objects, recursive ) {
intersectObjects: function ( objects, recursive
, optionalTarget
) {
var intersects = [];
var intersects =
optionalTarget ||
[];
if ( Array.isArray( objects ) === false ) {
...
...
@@ -44725,6 +44738,58 @@ Object.assign( Ray.prototype, {
} );
Object.assign( Triangle.prototype, {
area: function () {
console.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' );
return this.getArea();
},
barycoordFromPoint: function ( point, target ) {
console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
return this.getBarycoord( point, target );
},
midpoint: function ( target ) {
console.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' );
return this.getMidpoint( target );
},
normal: function ( target ) {
console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
return this.getNormal( target );
},
plane: function ( target ) {
console.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' );
return this.getPlane( target );
}
} );
Object.assign( Triangle, {
barycoordFromPoint: function ( point, a, b, c, target ) {
console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' );
return Triangle.getBarycoord( point, a, b, c, target );
},
normal: function ( a, b, c, target ) {
console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' );
return Triangle.getNormal( a, b, c, target );
}
} );
Object.assign( Shape.prototype, {
extractAllPoints: function ( divisions ) {
...
...
package.json
浏览文件 @
28894ccb
{
"name"
:
"three"
,
"version"
:
"0.9
0
.0"
,
"version"
:
"0.9
1
.0"
,
"description"
:
"JavaScript 3D library"
,
"main"
:
"build/three.js"
,
"repository"
:
"mrdoob/three.js"
,
...
...
src/constants.js
浏览文件 @
28894ccb
export
var
REVISION
=
'
91
dev
'
;
export
var
REVISION
=
'
91
'
;
export
var
MOUSE
=
{
LEFT
:
0
,
MIDDLE
:
1
,
RIGHT
:
2
};
export
var
CullFaceNone
=
0
;
export
var
CullFaceBack
=
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录