Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
4fb8c5f8
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,发现更多精彩内容 >>
提交
4fb8c5f8
编写于
10月 10, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
486fe726
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
1078 addition
and
877 deletion
+1078
-877
build/three.js
build/three.js
+173
-73
build/three.min.js
build/three.min.js
+732
-731
build/three.module.js
build/three.module.js
+173
-73
未找到文件。
build/three.js
浏览文件 @
4fb8c5f8
...
...
@@ -8362,56 +8362,58 @@
// Computes the world-axis-aligned bounding box of an object (including its children),
// accounting for both the object's, and children's, world transforms
var scope, i, l;
var v1 = new Vector3();
return function expandByObject( object
) {
function traverse( node
) {
var
scope = this
;
var
geometry = node.geometry
;
object.updateMatrixWorld( true );
if ( geometry !== undefined ) {
object.traverse( function ( node
) {
if ( geometry.isGeometry
) {
var i, l
;
var vertices = geometry.vertices
;
var geometry = node.geometry;
for ( i = 0, l = vertices.length; i < l; i ++ ) {
if ( geometry !== undefined ) {
v1.copy( vertices[ i ] );
v1.applyMatrix4( node.matrixWorld );
if ( geometry.isGeometry ) {
scope.expandByPoint( v1 );
var vertices = geometry.vertices;
}
for ( i = 0, l = vertices.length; i < l; i ++
) {
} else if ( geometry.isBufferGeometry
) {
v1.copy( vertices[ i ] );
v1.applyMatrix4( node.matrixWorld );
var attribute = geometry.attributes.position;
scope.expandByPoint( v1 );
if ( attribute !== undefined ) {
}
for ( i = 0, l = attribute.count; i < l; i ++ ) {
} else if ( geometry.isBufferGeometry ) {
v1.fromBufferAttribute( attribute, i ).applyMatrix4( node.matrixWorld );
var attribute = geometry.attributes.position
;
scope.expandByPoint( v1 )
;
if ( attribute !== undefined ) {
}
for ( i = 0, l = attribute.count; i < l; i ++ ) {
}
v1.fromBufferAttribute( attribute, i ).applyMatrix4( node.matrixWorld );
}
scope.expandByPoint( v1 );
}
}
}
}
return function expandByObject( object ) {
}
scope = this;
}
object.updateMatrixWorld( true );
}
);
object.traverse( traverse
);
return this;
...
...
@@ -10358,6 +10360,26 @@
}(),
rotateOnWorldAxis: function () {
// rotate object on axis in world space
// axis is assumed to be normalized
// method assumes no rotated parent
var q1 = new Quaternion();
return function rotateOnWorldAxis( axis, angle ) {
q1.setFromAxisAngle( axis, angle );
this.quaternion.premultiply( q1 );
return this;
};
}(),
rotateX: function () {
var v1 = new Vector3( 1, 0, 0 );
...
...
@@ -20552,7 +20574,7 @@
var device = null;
var frameData = null;
if ( 'VRFrameData' in window ) {
if (
typeof window !== 'undefined' &&
'VRFrameData' in window ) {
frameData = new window.VRFrameData();
...
...
@@ -20600,7 +20622,11 @@
}
window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
if ( typeof window !== 'undefined' ) {
window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
}
//
...
...
@@ -26045,6 +26071,7 @@
var vertex = new Vector3();
var normal = new Vector3();
var uv = new Vector2();
var P = new Vector3();
var i, j;
...
...
@@ -26098,7 +26125,7 @@
// we use getPointAt to sample evenly distributed points from the given path
var P = path.getPointAt( i / tubularSegments
);
P = path.getPointAt( i / tubularSegments, P
);
// retrieve corresponding normal and binormal
...
...
@@ -34405,9 +34432,13 @@
break;
case 'DodecahedronGeometry':
case 'DodecahedronBufferGeometry':
case 'IcosahedronGeometry':
case 'IcosahedronBufferGeometry':
case 'OctahedronGeometry':
case 'OctahedronBufferGeometry':
case 'TetrahedronGeometry':
case 'TetrahedronBufferGeometry':
geometry = new Geometries[ data.type ](
data.radius,
...
...
@@ -34469,6 +34500,18 @@
break;
case 'PolyhedronGeometry':
case 'PolyhedronBufferGeometry':
geometry = new Geometries[ data.type ](
data.vertices,
data.indices,
data.radius,
data.details
);
break;
case 'BufferGeometry':
geometry = bufferGeometryLoader.parse( data );
...
...
@@ -35067,8 +35110,8 @@
* Extensible curve object
*
* Some common of curve methods:
* .getPoint(
t), getTangent(t
)
* .getPointAt(
u), getTangentAt(u
)
* .getPoint(
t, optionalTarget ), .getTangent( t
)
* .getPointAt(
u, optionalTarget ), .getTangentAt( u
)
* .getPoints(), .getSpacedPoints()
* .getLength()
* .updateArcLengths()
...
...
@@ -35108,7 +35151,7 @@
// Virtual base class method to overwrite and implement in subclasses
// - t [0 .. 1]
getPoint: function () {
getPoint: function (
/* t, optionalTarget */
) {
console.warn( 'THREE.Curve: .getPoint() not implemented.' );
return null;
...
...
@@ -35118,10 +35161,10 @@
// Get point at relative position in curve according to arc length
// - u [0 .. 1]
getPointAt: function ( u ) {
getPointAt: function ( u
, optionalTarget
) {
var t = this.getUtoTmapping( u );
return this.getPoint( t );
return this.getPoint( t
, optionalTarget
);
},
...
...
@@ -35454,16 +35497,20 @@
LineCurve.prototype.isLineCurve = true;
LineCurve.prototype.getPoint = function ( t ) {
LineCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
if ( t === 1 ) {
return this.v2.clone(
);
point.copy( this.v2
);
}
} else {
point.copy( this.v2 ).sub( this.v1 );
point.multiplyScalar( t ).add( this.v1 );
var point = this.v2.clone().sub( this.v1 );
point.multiplyScalar( t ).add( this.v1 );
}
return point;
...
...
@@ -35471,9 +35518,9 @@
// Line curve is linear, so we can overwrite default getPointAt
LineCurve.prototype.getPointAt = function ( u ) {
LineCurve.prototype.getPointAt = function ( u
, optionalTarget
) {
return this.getPoint( u );
return this.getPoint( u
, optionalTarget
);
};
...
...
@@ -35745,7 +35792,9 @@
EllipseCurve.prototype.isEllipseCurve = true;
EllipseCurve.prototype.getPoint = function ( t ) {
EllipseCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
var twoPi = Math.PI * 2;
var deltaAngle = this.aEndAngle - this.aStartAngle;
...
...
@@ -35801,7 +35850,7 @@
}
return
new Vector2
( x, y );
return
point.set
( x, y );
};
...
...
@@ -35818,24 +35867,28 @@
SplineCurve.prototype.isSplineCurve = true;
SplineCurve.prototype.getPoint = function ( t ) {
SplineCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
var points = this.points;
var p
oint
= ( points.length - 1 ) * t;
var p = ( points.length - 1 ) * t;
var intPoint = Math.floor( p
oint
);
var weight = p
oint
- intPoint;
var intPoint = Math.floor( p );
var weight = p - intPoint;
var p
oint
0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];
var p
oint
1 = points[ intPoint ];
var p
oint
2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];
var p
oint
3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];
var p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];
var p1 = points[ intPoint ];
var p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];
var p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];
return new Vector2
(
CatmullRom( weight, p
oint0.x, point1.x, point2.x, point
3.x ),
CatmullRom( weight, p
oint0.y, point1.y, point2.y, point
3.y )
point.set
(
CatmullRom( weight, p
0.x, p1.x, p2.x, p
3.x ),
CatmullRom( weight, p
0.y, p1.y, p2.y, p
3.y )
);
return point;
};
function CubicBezierCurve( v0, v1, v2, v3 ) {
...
...
@@ -35852,15 +35905,21 @@
CubicBezierCurve.prototype = Object.create( Curve.prototype );
CubicBezierCurve.prototype.constructor = CubicBezierCurve;
CubicBezierCurve.prototype.getPoint = function ( t ) {
CubicBezierCurve.prototype.isCubicBezierCurve = true;
CubicBezierCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
return new Vector2
(
point.set
(
CubicBezier( t, v0.x, v1.x, v2.x, v3.x ),
CubicBezier( t, v0.y, v1.y, v2.y, v3.y )
);
return point;
};
function QuadraticBezierCurve( v0, v1, v2 ) {
...
...
@@ -35876,15 +35935,21 @@
QuadraticBezierCurve.prototype = Object.create( Curve.prototype );
QuadraticBezierCurve.prototype.constructor = QuadraticBezierCurve;
QuadraticBezierCurve.prototype.getPoint = function ( t ) {
QuadraticBezierCurve.prototype.isQuadraticBezierCurve = true;
QuadraticBezierCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
var v0 = this.v0, v1 = this.v1, v2 = this.v2;
return new Vector2
(
point.set
(
QuadraticBezier( t, v0.x, v1.x, v2.x ),
QuadraticBezier( t, v0.y, v1.y, v2.y )
);
return point;
};
var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), {
...
...
@@ -42416,14 +42481,18 @@
CatmullRomCurve3.prototype = Object.create( Curve.prototype );
CatmullRomCurve3.prototype.constructor = CatmullRomCurve3;
CatmullRomCurve3.prototype.getPoint = function ( t ) {
CatmullRomCurve3.prototype.isCatmullRomCurve3 = true;
CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector3();
var points = this.points;
var l = points.length;
var p
oint
= ( l - ( this.closed ? 0 : 1 ) ) * t;
var intPoint = Math.floor( p
oint
);
var weight = p
oint
- intPoint;
var p = ( l - ( this.closed ? 0 : 1 ) ) * t;
var intPoint = Math.floor( p );
var weight = p - intPoint;
if ( this.closed ) {
...
...
@@ -42491,7 +42560,13 @@
}
return new Vector3( px.calc( weight ), py.calc( weight ), pz.calc( weight ) );
point.set(
px.calc( weight ),
py.calc( weight ),
pz.calc( weight )
);
return point;
};
...
...
@@ -42509,16 +42584,22 @@
CubicBezierCurve3.prototype = Object.create( Curve.prototype );
CubicBezierCurve3.prototype.constructor = CubicBezierCurve3;
CubicBezierCurve3.prototype.getPoint = function ( t ) {
CubicBezierCurve3.prototype.isCubicBezierCurve3 = true;
CubicBezierCurve3.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector3();
var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
return new Vector3
(
point.set
(
CubicBezier( t, v0.x, v1.x, v2.x, v3.x ),
CubicBezier( t, v0.y, v1.y, v2.y, v3.y ),
CubicBezier( t, v0.z, v1.z, v2.z, v3.z )
);
return point;
};
function QuadraticBezierCurve3( v0, v1, v2 ) {
...
...
@@ -42534,16 +42615,22 @@
QuadraticBezierCurve3.prototype = Object.create( Curve.prototype );
QuadraticBezierCurve3.prototype.constructor = QuadraticBezierCurve3;
QuadraticBezierCurve3.prototype.getPoint = function ( t ) {
QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true;
QuadraticBezierCurve3.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector3();
var v0 = this.v0, v1 = this.v1, v2 = this.v2;
return new Vector3
(
point.set
(
QuadraticBezier( t, v0.x, v1.x, v2.x ),
QuadraticBezier( t, v0.y, v1.y, v2.y ),
QuadraticBezier( t, v0.z, v1.z, v2.z )
);
return point;
};
function LineCurve3( v1, v2 ) {
...
...
@@ -42558,21 +42645,32 @@
LineCurve3.prototype = Object.create( Curve.prototype );
LineCurve3.prototype.constructor = LineCurve3;
LineCurve3.prototype.getPoint = function ( t ) {
LineCurve3.prototype.isLineCurve3 = true;
LineCurve3.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector3();
if ( t === 1 ) {
return this.v2.clone();
point.copy( this.v2 );
} else {
point.copy( this.v2 ).sub( this.v1 );
point.multiplyScalar( t ).add( this.v1 );
}
var vector = new Vector3()
;
return point
;
vector.subVectors( this.v2, this.v1 ); // diff
vector.multiplyScalar( t );
vector.add( this.v1 );
};
// Line curve is linear, so we can overwrite default getPointAt
return vector;
LineCurve3.prototype.getPointAt = function ( u, optionalTarget ) {
return this.getPoint( u, optionalTarget );
};
...
...
@@ -42585,6 +42683,8 @@
ArcCurve.prototype = Object.create( EllipseCurve.prototype );
ArcCurve.prototype.constructor = ArcCurve;
ArcCurve.prototype.isArcCurve = true;
/**
* @author alteredq / http://alteredqualia.com/
*/
build/three.min.js
浏览文件 @
4fb8c5f8
此差异已折叠。
点击以展开。
build/three.module.js
浏览文件 @
4fb8c5f8
...
...
@@ -8356,56 +8356,58 @@ Object.assign( Box3.prototype, {
// Computes the world-axis-aligned bounding box of an object (including its children),
// accounting for both the object's, and children's, world transforms
var scope, i, l;
var v1 = new Vector3();
return function expandByObject( object
) {
function traverse( node
) {
var
scope = this
;
var
geometry = node.geometry
;
object.updateMatrixWorld( true );
if ( geometry !== undefined ) {
object.traverse( function ( node
) {
if ( geometry.isGeometry
) {
var i, l
;
var vertices = geometry.vertices
;
var geometry = node.geometry;
for ( i = 0, l = vertices.length; i < l; i ++ ) {
if ( geometry !== undefined ) {
v1.copy( vertices[ i ] );
v1.applyMatrix4( node.matrixWorld );
if ( geometry.isGeometry ) {
scope.expandByPoint( v1 );
var vertices = geometry.vertices;
}
for ( i = 0, l = vertices.length; i < l; i ++
) {
} else if ( geometry.isBufferGeometry
) {
v1.copy( vertices[ i ] );
v1.applyMatrix4( node.matrixWorld );
var attribute = geometry.attributes.position;
scope.expandByPoint( v1 );
if ( attribute !== undefined ) {
}
for ( i = 0, l = attribute.count; i < l; i ++ ) {
} else if ( geometry.isBufferGeometry ) {
v1.fromBufferAttribute( attribute, i ).applyMatrix4( node.matrixWorld );
var attribute = geometry.attributes.position
;
scope.expandByPoint( v1 )
;
if ( attribute !== undefined ) {
}
for ( i = 0, l = attribute.count; i < l; i ++ ) {
}
v1.fromBufferAttribute( attribute, i ).applyMatrix4( node.matrixWorld );
}
scope.expandByPoint( v1 );
}
}
}
}
return function expandByObject( object ) {
}
scope = this;
}
object.updateMatrixWorld( true );
}
);
object.traverse( traverse
);
return this;
...
...
@@ -10352,6 +10354,26 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
}(),
rotateOnWorldAxis: function () {
// rotate object on axis in world space
// axis is assumed to be normalized
// method assumes no rotated parent
var q1 = new Quaternion();
return function rotateOnWorldAxis( axis, angle ) {
q1.setFromAxisAngle( axis, angle );
this.quaternion.premultiply( q1 );
return this;
};
}(),
rotateX: function () {
var v1 = new Vector3( 1, 0, 0 );
...
...
@@ -20546,7 +20568,7 @@ function WebVRManager( renderer ) {
var device = null;
var frameData = null;
if ( 'VRFrameData' in window ) {
if (
typeof window !== 'undefined' &&
'VRFrameData' in window ) {
frameData = new window.VRFrameData();
...
...
@@ -20594,7 +20616,11 @@ function WebVRManager( renderer ) {
}
window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
if ( typeof window !== 'undefined' ) {
window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
}
//
...
...
@@ -26039,6 +26065,7 @@ function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, clos
var vertex = new Vector3();
var normal = new Vector3();
var uv = new Vector2();
var P = new Vector3();
var i, j;
...
...
@@ -26092,7 +26119,7 @@ function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, clos
// we use getPointAt to sample evenly distributed points from the given path
var P = path.getPointAt( i / tubularSegments
);
P = path.getPointAt( i / tubularSegments, P
);
// retrieve corresponding normal and binormal
...
...
@@ -34399,9 +34426,13 @@ Object.assign( ObjectLoader.prototype, {
break;
case 'DodecahedronGeometry':
case 'DodecahedronBufferGeometry':
case 'IcosahedronGeometry':
case 'IcosahedronBufferGeometry':
case 'OctahedronGeometry':
case 'OctahedronBufferGeometry':
case 'TetrahedronGeometry':
case 'TetrahedronBufferGeometry':
geometry = new Geometries[ data.type ](
data.radius,
...
...
@@ -34463,6 +34494,18 @@ Object.assign( ObjectLoader.prototype, {
break;
case 'PolyhedronGeometry':
case 'PolyhedronBufferGeometry':
geometry = new Geometries[ data.type ](
data.vertices,
data.indices,
data.radius,
data.details
);
break;
case 'BufferGeometry':
geometry = bufferGeometryLoader.parse( data );
...
...
@@ -35061,8 +35104,8 @@ function CubicBezier( t, p0, p1, p2, p3 ) {
* Extensible curve object
*
* Some common of curve methods:
* .getPoint(
t), getTangent(t
)
* .getPointAt(
u), getTangentAt(u
)
* .getPoint(
t, optionalTarget ), .getTangent( t
)
* .getPointAt(
u, optionalTarget ), .getTangentAt( u
)
* .getPoints(), .getSpacedPoints()
* .getLength()
* .updateArcLengths()
...
...
@@ -35102,7 +35145,7 @@ Object.assign( Curve.prototype, {
// Virtual base class method to overwrite and implement in subclasses
// - t [0 .. 1]
getPoint: function () {
getPoint: function (
/* t, optionalTarget */
) {
console.warn( 'THREE.Curve: .getPoint() not implemented.' );
return null;
...
...
@@ -35112,10 +35155,10 @@ Object.assign( Curve.prototype, {
// Get point at relative position in curve according to arc length
// - u [0 .. 1]
getPointAt: function ( u ) {
getPointAt: function ( u
, optionalTarget
) {
var t = this.getUtoTmapping( u );
return this.getPoint( t );
return this.getPoint( t
, optionalTarget
);
},
...
...
@@ -35448,16 +35491,20 @@ LineCurve.prototype.constructor = LineCurve;
LineCurve.prototype.isLineCurve = true;
LineCurve.prototype.getPoint = function ( t ) {
LineCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
if ( t === 1 ) {
return this.v2.clone(
);
point.copy( this.v2
);
}
} else {
point.copy( this.v2 ).sub( this.v1 );
point.multiplyScalar( t ).add( this.v1 );
var point = this.v2.clone().sub( this.v1 );
point.multiplyScalar( t ).add( this.v1 );
}
return point;
...
...
@@ -35465,9 +35512,9 @@ LineCurve.prototype.getPoint = function ( t ) {
// Line curve is linear, so we can overwrite default getPointAt
LineCurve.prototype.getPointAt = function ( u ) {
LineCurve.prototype.getPointAt = function ( u
, optionalTarget
) {
return this.getPoint( u );
return this.getPoint( u
, optionalTarget
);
};
...
...
@@ -35739,7 +35786,9 @@ EllipseCurve.prototype.constructor = EllipseCurve;
EllipseCurve.prototype.isEllipseCurve = true;
EllipseCurve.prototype.getPoint = function ( t ) {
EllipseCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
var twoPi = Math.PI * 2;
var deltaAngle = this.aEndAngle - this.aStartAngle;
...
...
@@ -35795,7 +35844,7 @@ EllipseCurve.prototype.getPoint = function ( t ) {
}
return
new Vector2
( x, y );
return
point.set
( x, y );
};
...
...
@@ -35812,24 +35861,28 @@ SplineCurve.prototype.constructor = SplineCurve;
SplineCurve.prototype.isSplineCurve = true;
SplineCurve.prototype.getPoint = function ( t ) {
SplineCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
var points = this.points;
var p
oint
= ( points.length - 1 ) * t;
var p = ( points.length - 1 ) * t;
var intPoint = Math.floor( p
oint
);
var weight = p
oint
- intPoint;
var intPoint = Math.floor( p );
var weight = p - intPoint;
var p
oint
0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];
var p
oint
1 = points[ intPoint ];
var p
oint
2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];
var p
oint
3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];
var p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];
var p1 = points[ intPoint ];
var p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];
var p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];
return new Vector2
(
CatmullRom( weight, p
oint0.x, point1.x, point2.x, point
3.x ),
CatmullRom( weight, p
oint0.y, point1.y, point2.y, point
3.y )
point.set
(
CatmullRom( weight, p
0.x, p1.x, p2.x, p
3.x ),
CatmullRom( weight, p
0.y, p1.y, p2.y, p
3.y )
);
return point;
};
function CubicBezierCurve( v0, v1, v2, v3 ) {
...
...
@@ -35846,15 +35899,21 @@ function CubicBezierCurve( v0, v1, v2, v3 ) {
CubicBezierCurve.prototype = Object.create( Curve.prototype );
CubicBezierCurve.prototype.constructor = CubicBezierCurve;
CubicBezierCurve.prototype.getPoint = function ( t ) {
CubicBezierCurve.prototype.isCubicBezierCurve = true;
CubicBezierCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
return new Vector2
(
point.set
(
CubicBezier( t, v0.x, v1.x, v2.x, v3.x ),
CubicBezier( t, v0.y, v1.y, v2.y, v3.y )
);
return point;
};
function QuadraticBezierCurve( v0, v1, v2 ) {
...
...
@@ -35870,15 +35929,21 @@ function QuadraticBezierCurve( v0, v1, v2 ) {
QuadraticBezierCurve.prototype = Object.create( Curve.prototype );
QuadraticBezierCurve.prototype.constructor = QuadraticBezierCurve;
QuadraticBezierCurve.prototype.getPoint = function ( t ) {
QuadraticBezierCurve.prototype.isQuadraticBezierCurve = true;
QuadraticBezierCurve.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector2();
var v0 = this.v0, v1 = this.v1, v2 = this.v2;
return new Vector2
(
point.set
(
QuadraticBezier( t, v0.x, v1.x, v2.x ),
QuadraticBezier( t, v0.y, v1.y, v2.y )
);
return point;
};
var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), {
...
...
@@ -42410,14 +42475,18 @@ function CatmullRomCurve3( points ) {
CatmullRomCurve3.prototype = Object.create( Curve.prototype );
CatmullRomCurve3.prototype.constructor = CatmullRomCurve3;
CatmullRomCurve3.prototype.getPoint = function ( t ) {
CatmullRomCurve3.prototype.isCatmullRomCurve3 = true;
CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector3();
var points = this.points;
var l = points.length;
var p
oint
= ( l - ( this.closed ? 0 : 1 ) ) * t;
var intPoint = Math.floor( p
oint
);
var weight = p
oint
- intPoint;
var p = ( l - ( this.closed ? 0 : 1 ) ) * t;
var intPoint = Math.floor( p );
var weight = p - intPoint;
if ( this.closed ) {
...
...
@@ -42485,7 +42554,13 @@ CatmullRomCurve3.prototype.getPoint = function ( t ) {
}
return new Vector3( px.calc( weight ), py.calc( weight ), pz.calc( weight ) );
point.set(
px.calc( weight ),
py.calc( weight ),
pz.calc( weight )
);
return point;
};
...
...
@@ -42503,16 +42578,22 @@ function CubicBezierCurve3( v0, v1, v2, v3 ) {
CubicBezierCurve3.prototype = Object.create( Curve.prototype );
CubicBezierCurve3.prototype.constructor = CubicBezierCurve3;
CubicBezierCurve3.prototype.getPoint = function ( t ) {
CubicBezierCurve3.prototype.isCubicBezierCurve3 = true;
CubicBezierCurve3.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector3();
var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
return new Vector3
(
point.set
(
CubicBezier( t, v0.x, v1.x, v2.x, v3.x ),
CubicBezier( t, v0.y, v1.y, v2.y, v3.y ),
CubicBezier( t, v0.z, v1.z, v2.z, v3.z )
);
return point;
};
function QuadraticBezierCurve3( v0, v1, v2 ) {
...
...
@@ -42528,16 +42609,22 @@ function QuadraticBezierCurve3( v0, v1, v2 ) {
QuadraticBezierCurve3.prototype = Object.create( Curve.prototype );
QuadraticBezierCurve3.prototype.constructor = QuadraticBezierCurve3;
QuadraticBezierCurve3.prototype.getPoint = function ( t ) {
QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true;
QuadraticBezierCurve3.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector3();
var v0 = this.v0, v1 = this.v1, v2 = this.v2;
return new Vector3
(
point.set
(
QuadraticBezier( t, v0.x, v1.x, v2.x ),
QuadraticBezier( t, v0.y, v1.y, v2.y ),
QuadraticBezier( t, v0.z, v1.z, v2.z )
);
return point;
};
function LineCurve3( v1, v2 ) {
...
...
@@ -42552,21 +42639,32 @@ function LineCurve3( v1, v2 ) {
LineCurve3.prototype = Object.create( Curve.prototype );
LineCurve3.prototype.constructor = LineCurve3;
LineCurve3.prototype.getPoint = function ( t ) {
LineCurve3.prototype.isLineCurve3 = true;
LineCurve3.prototype.getPoint = function ( t, optionalTarget ) {
var point = optionalTarget || new Vector3();
if ( t === 1 ) {
return this.v2.clone();
point.copy( this.v2 );
} else {
point.copy( this.v2 ).sub( this.v1 );
point.multiplyScalar( t ).add( this.v1 );
}
var vector = new Vector3()
;
return point
;
vector.subVectors( this.v2, this.v1 ); // diff
vector.multiplyScalar( t );
vector.add( this.v1 );
};
// Line curve is linear, so we can overwrite default getPointAt
return vector;
LineCurve3.prototype.getPointAt = function ( u, optionalTarget ) {
return this.getPoint( u, optionalTarget );
};
...
...
@@ -42579,6 +42677,8 @@ function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {
ArcCurve.prototype = Object.create( EllipseCurve.prototype );
ArcCurve.prototype.constructor = ArcCurve;
ArcCurve.prototype.isArcCurve = true;
/**
* @author alteredq / http://alteredqualia.com/
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录