Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
394dda9b
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,发现更多精彩内容 >>
提交
394dda9b
编写于
12月 04, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
18f4c2cd
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
26 deletion
+56
-26
build/three.js
build/three.js
+45
-15
build/three.min.js
build/three.min.js
+11
-11
未找到文件。
build/three.js
浏览文件 @
394dda9b
...
...
@@ -3376,12 +3376,14 @@ THREE.Box2.prototype = {
},
getParameter: function ( point ) {
getParameter: function ( point
, optionalTarget
) {
// This can potentially have a divide by zero if the box
// has a size dimension of 0.
return new THREE.Vector2(
var result = optionalTarget || new THREE.Vector2();
return result.set(
( point.x - this.min.x ) / ( this.max.x - this.min.x ),
( point.y - this.min.y ) / ( this.max.y - this.min.y )
);
...
...
@@ -3701,12 +3703,14 @@ THREE.Box3.prototype = {
},
getParameter: function ( point ) {
getParameter: function ( point
, optionalTarget
) {
// This can potentially have a divide by zero if the box
// has a size dimension of 0.
return new THREE.Vector3(
var result = optionalTarget || new THREE.Vector3();
return result.set(
( point.x - this.min.x ) / ( this.max.x - this.min.x ),
( point.y - this.min.y ) / ( this.max.y - this.min.y ),
( point.z - this.min.z ) / ( this.max.z - this.min.z )
...
...
@@ -28559,7 +28563,8 @@ THREE.CurvePath.prototype.getWrapPoints = function ( oldPts, path ) {
// check for out of bounds?
var pathPt = path.getPoint( xNorm );
var normal = path.getNormalVector( xNorm ).multiplyScalar( oldY );
var normal = path.getNormalVector( xNorm );
normal.set( -normal.y, normal.x ).multiplyScalar( oldY );
p.x = pathPt.x + normal.x;
p.y = pathPt.y + normal.y;
...
...
@@ -30518,7 +30523,18 @@ THREE.Animation.prototype.update = function ( deltaTimeMS ) {
this.currentTime += deltaTimeMS * this.timeScale;
unloopedCurrentTime = this.currentTime;
// Mod operation fails on floats
// was this supposed to be in frames?
while ( this.currentTime > this.data.length ) {
this.currentTime -= this.data.length;
}
currentTime = this.currentTime = this.currentTime % this.data.length;
frame = parseInt( Math.min( currentTime * this.data.fps, this.data.length * this.data.fps ), 10 );
...
...
@@ -30538,19 +30554,20 @@ THREE.Animation.prototype.update = function ( deltaTimeMS ) {
nextKey = animationCache.nextKey[ type ];
// switch keys?
if ( nextKey.time <= unloopedCurrentTime ) {
// did we loop?
if ( currentTime < unloopedCurrentTime ) {
if ( currentTime <
=
unloopedCurrentTime ) {
if ( this.loop ) {
prevKey = this.data.hierarchy[ h ].keys[ 0 ];
nextKey = this.getNextKeyWith( type, h, 1 );
while( nextKey.time < currentTime ) {
// if ( nextKey.index < prevKey.index ) then we have wrapped over the end, and nextKey.time < currentTime will loop forever
while ( nextKey !== null && nextKey.time < currentTime && nextKey.index > prevKey.index) {
prevKey = nextKey;
nextKey = this.getNextKeyWith( type, h, nextKey.index + 1 );
...
...
@@ -30571,7 +30588,8 @@ THREE.Animation.prototype.update = function ( deltaTimeMS ) {
prevKey = nextKey;
nextKey = this.getNextKeyWith( type, h, nextKey.index + 1 );
} while( nextKey.time < currentTime )
} while ( nextKey !== null && nextKey.time < currentTime && nextKey.index > prevKey.index )
// if ( nextKey.index < prevKey.index ) then we have wrapped over the end, and nextKey.time < currentTime will loop forever
}
...
...
@@ -34002,9 +34020,11 @@ THREE.AxisHelper.prototype = Object.create( THREE.Line.prototype );
* origin - Vector3
* length - Number
* hex - color in hex value
* headLength - Number
* headWidth - Number
*/
THREE.ArrowHelper = function ( dir, origin, length, hex ) {
THREE.ArrowHelper = function ( dir, origin, length, hex
, headLength, headWidth
) {
// dir is assumed to be normalized
...
...
@@ -34012,6 +34032,8 @@ THREE.ArrowHelper = function ( dir, origin, length, hex ) {
if ( hex === undefined ) hex = 0xffff00;
if ( length === undefined ) length = 1;
if ( headLength === undefined ) headLength = 0.2 * length;
if ( headWidth === undefined ) headWidth = 0.2 * headLength;
this.position = origin;
...
...
@@ -34023,15 +34045,15 @@ THREE.ArrowHelper = function ( dir, origin, length, hex ) {
this.line.matrixAutoUpdate = false;
this.add( this.line );
var coneGeometry = new THREE.CylinderGeometry( 0, 0.
05, 0.25
, 5, 1 );
coneGeometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0,
0.87
5, 0 ) );
var coneGeometry = new THREE.CylinderGeometry( 0, 0.
5, 1
, 5, 1 );
coneGeometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0,
- 0.
5, 0 ) );
this.cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color: hex } ) );
this.cone.matrixAutoUpdate = false;
this.add( this.cone );
this.setDirection( dir );
this.setLength( length );
this.setLength( length
, headLength, headWidth
);
};
...
...
@@ -34068,9 +34090,17 @@ THREE.ArrowHelper.prototype.setDirection = function () {
}();
THREE.ArrowHelper.prototype.setLength = function ( length ) {
THREE.ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) {
if ( headLength === undefined ) headLength = 0.2 * length;
if ( headWidth === undefined ) headWidth = 0.2 * headLength;
this.line.scale.set( 1, length, 1 );
this.line.updateMatrix();
this.scale.set( length, length, length );
this.cone.scale.set( headWidth, headLength, headWidth );
this.cone.position.y = length;
this.cone.updateMatrix();
};
...
...
build/three.min.js
浏览文件 @
394dda9b
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录