Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
3d5da598
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,发现更多精彩内容 >>
提交
3d5da598
编写于
6月 29, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
6b6eb8f0
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
79 addition
and
56 deletion
+79
-56
build/three.js
build/three.js
+66
-44
build/three.min.js
build/three.min.js
+13
-12
未找到文件。
build/three.js
浏览文件 @
3d5da598
...
...
@@ -3927,7 +3927,7 @@ THREE.Box3.prototype = {
setFromObject: function () {
// Computes the world-axis-aligned bounding box of an object (including its children),
// accounting for both the object's, and children
s'
, world transforms
// accounting for both the object's, and children
's
, world transforms
var v1 = new THREE.Vector3();
...
...
@@ -7022,7 +7022,7 @@ THREE.Triangle.normal = function () {
}();
// static/instance method to calculate barycoordinates
// static/instance method to calculate baryc
entric c
oordinates
// based on: http://www.blackpawn.com/texts/pointinpoly/default.html
THREE.Triangle.barycoordFromPoint = function () {
...
...
@@ -7046,7 +7046,7 @@ THREE.Triangle.barycoordFromPoint = function () {
var result = optionalTarget || new THREE.Vector3();
// colinear or singular triangle
// col
l
inear or singular triangle
if ( denom === 0 ) {
// arbitrary location outside of triangle?
// not sure if this is the best idea, maybe should be returning undefined
...
...
@@ -7057,7 +7057,7 @@ THREE.Triangle.barycoordFromPoint = function () {
var u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;
var v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;
// barycoordinates must always sum to 1
// baryc
entric c
oordinates must always sum to 1
return result.set( 1 - u - v, v, u );
};
...
...
@@ -9641,11 +9641,11 @@ THREE.Geometry.prototype = {
mergeVertices: function () {
var verticesMap = {}; // Hashmap for looking up vertice by position coordinates (and making sure they are unique)
var verticesMap = {}; // Hashmap for looking up vertice
s
by position coordinates (and making sure they are unique)
var unique = [], changes = [];
var v, key;
var precisionPoints = 4; // number of decimal points, eg. 4 for epsilon of 0.0001
var precisionPoints = 4; // number of decimal points, e
.
g. 4 for epsilon of 0.0001
var precision = Math.pow( 10, precisionPoints );
var i, il, face;
var indices, j, jl;
...
...
@@ -10422,6 +10422,14 @@ THREE.BufferGeometry.prototype = {
this.addAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) );
this.addAttribute( 'color', colors.copyColorsArray( geometry.colors ) );
if ( geometry.lineDistances && geometry.lineDistances.length === geometry.vertices.length ) {
var lineDistances = new THREE.Float32Attribute( geometry.lineDistances.length, 1 );
this.addAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) );
}
if ( geometry.boundingSphere !== null ) {
this.boundingSphere = geometry.boundingSphere.clone();
...
...
@@ -10532,6 +10540,21 @@ THREE.BufferGeometry.prototype = {
}
if ( geometry.lineDistancesNeedUpdate ) {
var attribute = this.attributes.lineDistance;
if ( attribute !== undefined ) {
attribute.copyArray( geometry.lineDistances );
attribute.needsUpdate = true;
}
geometry.lineDistancesNeedUpdate = false;
}
return this;
},
...
...
@@ -11105,7 +11128,7 @@ THREE.BufferGeometry.prototype = {
for ( var vo = 0; vo < 3; vo ++ ) {
var vid = indices[ findex * 3 + vo ];
if ( vertexMap[ vid ] === - 1 ) {
//Unmapped vert
ice
//Unmapped vert
ex
faceVertices[ vo * 2 ] = vid;
faceVertices[ vo * 2 + 1 ] = - 1;
newVerticeMaps ++;
...
...
@@ -11115,7 +11138,7 @@ THREE.BufferGeometry.prototype = {
faceVertices[ vo * 2 + 1 ] = - 1;
duplicatedVertices ++;
} else {
//Reused vert
ice
in the current block
//Reused vert
ex
in the current block
faceVertices[ vo * 2 ] = vid;
faceVertices[ vo * 2 + 1 ] = vertexMap[ vid ];
}
...
...
@@ -11150,7 +11173,7 @@ THREE.BufferGeometry.prototype = {
}
}
/* Move all attribute values to map to the new computed indices , also expand the vert
ice
stack to match our new vertexPtr. */
/* Move all attribute values to map to the new computed indices , also expand the vert
ex
stack to match our new vertexPtr. */
this.reorderBuffers( sortedIndices, revVertexMap, vertexPtr );
this.offsets = offsets; // TODO: Deprecate
this.drawcalls = offsets;
...
...
@@ -11231,7 +11254,7 @@ THREE.BufferGeometry.prototype = {
Reorder attributes based on a new indexBuffer and indexMap.
indexBuffer - Uint16Array of the new ordered indices.
indexMap - Int32Array where the position is the new vertex ID and the value the old vertex ID for each vertex.
vertexCount - Amount of total vertices considered in this reordering (in case you want to grow the vert
ice
stack).
vertexCount - Amount of total vertices considered in this reordering (in case you want to grow the vert
ex
stack).
*/
reorderBuffers: function ( indexBuffer, indexMap, vertexCount ) {
...
...
@@ -11700,7 +11723,7 @@ THREE.PerspectiveCamera.prototype.constructor = THREE.PerspectiveCamera;
/**
* Uses Focal Length (in mm) to estimate and set FOV
* 35mm (fullframe) camera is used if frame size is not specified;
* 35mm (full
-
frame) camera is used if frame size is not specified;
* Formula based on http://www.bobatkins.com/photography/technical/field_of_view.html
*/
...
...
@@ -12938,7 +12961,7 @@ THREE.JSONLoader.prototype.constructor = THREE.JSONLoader;
THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) {
//
todo
: unify load API to for easier SceneLoader use
//
TODO
: unify load API to for easier SceneLoader use
texturePath = texturePath && ( typeof texturePath === 'string' ) ? texturePath : this.extractUrlBase( url );
...
...
@@ -14030,7 +14053,7 @@ THREE.ObjectLoader.prototype = {
if ( data.image === undefined ) {
console.warn( 'THREE.ObjectLoader: No "image" spe
fic
ied for', data.uuid );
console.warn( 'THREE.ObjectLoader: No "image" spe
cif
ied for', data.uuid );
}
...
...
@@ -14587,7 +14610,7 @@ THREE.Material.prototype = {
} else if ( key === 'overdraw' ) {
// ensure overdraw is backwards-compat
a
ble with legacy boolean type
// ensure overdraw is backwards-compat
i
ble with legacy boolean type
this[ key ] = Number( newValue );
} else {
...
...
@@ -17236,7 +17259,7 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld = function( force ) {
} else {
console.warn( 'THREE.SkinnedMesh unrec
k
ognized bindMode: ' + this.bindMode );
console.warn( 'THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode );
}
...
...
@@ -17765,7 +17788,7 @@ THREE.LensFlare.prototype.add = function ( texture, size, distance, blending, co
texture: texture, // THREE.Texture
size: size, // size in pixels (-1 = use texture.width)
distance: distance, // distance (0-1) from light source (0=at light source)
x: 0, y: 0, z: 0, // screen position (-1 => 1) z = 0 is
ontop
z = 1 is back
x: 0, y: 0, z: 0, // screen position (-1 => 1) z = 0 is
in front
z = 1 is back
scale: 1, // scale
rotation: 1, // rotation
opacity: opacity, // opacity
...
...
@@ -24464,7 +24487,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
object = webglObject.object;
// culling is overriden globally for all objects
// culling is overrid
d
en globally for all objects
// while rendering depth map
// need to deal with MeshFaceMaterial somehow
...
...
@@ -25501,7 +25524,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
state.disableUnusedAttributes();
// loop through all lens flares to update their occlusion and positions
// setup gl and common used attribs/unforms
// setup gl and common used attribs/un
i
forms
gl.uniform1i( uniforms.occlusionMap, 0 );
gl.uniform1i( uniforms.map, 1 );
...
...
@@ -27148,7 +27171,7 @@ THREE.Curve.prototype.updateArcLengths = function() {
this.getLengths();
};
// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equi
distance
// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equi
distant
THREE.Curve.prototype.getUtoTmapping = function ( u, distance ) {
...
...
@@ -27210,7 +27233,7 @@ THREE.Curve.prototype.getUtoTmapping = function ( u, distance ) {
}
// we could get finer grain at lengths, or use simple interpolat
at
ion between two points
// we could get finer grain at lengths, or use simple interpolation between two points
var lengthBefore = arcLengths[ i ];
var lengthAfter = arcLengths[ i + 1 ];
...
...
@@ -27451,7 +27474,7 @@ THREE.CurvePath.prototype.getCurveLengths = function() {
}
// Get length of sub
s
urve
// Get length of sub
-c
urve
// Push sums into cached array
var lengths = [], sums = 0;
...
...
@@ -27544,7 +27567,7 @@ THREE.CurvePath.prototype.createPointsGeometry = function( divisions ) {
};
// Generate geometry from equidistan
ce
sampling along the path
// Generate geometry from equidistan
t
sampling along the path
THREE.CurvePath.prototype.createSpacedPointsGeometry = function( divisions ) {
...
...
@@ -27760,7 +27783,7 @@ THREE.PathActions = {
LINE_TO: 'lineTo',
QUADRATIC_CURVE_TO: 'quadraticCurveTo', // Bezier quadratic curve
BEZIER_CURVE_TO: 'bezierCurveTo', // Bezier cubic curve
CSPLINE_THRU: 'splineThru', // Catmull-
r
om spline
CSPLINE_THRU: 'splineThru', // Catmull-
R
om spline
ARC: 'arc', // Circle
ELLIPSE: 'ellipse'
};
...
...
@@ -27941,7 +27964,6 @@ THREE.Path.prototype.getSpacedPoints = function ( divisions, closedPath ) {
THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
if (this.useSpacedPoints) {
console.log('tata');
return this.getSpacedPoints( divisions, closedPath );
}
...
...
@@ -28276,9 +28298,9 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
if ( perpEdge < 0 ) continue;
inside = ! inside; // true intersection left of inPt
}
} else { // parallel or colinear
} else { // parallel or col
l
inear
if ( inPt.y !== edgeLowPt.y ) continue; // parallel
// e
gd
e lies on the same horizontal line as inPt
// e
dg
e lies on the same horizontal line as inPt
if ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) ||
( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) ) return true; // inPt: Point on contour !
// continue;
...
...
@@ -28359,7 +28381,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
if ( newShapes.length > 1 ) {
var ambig
i
ous = false;
var ambig
u
ous = false;
var toChange = [];
for (var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {
...
...
@@ -28377,17 +28399,17 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
hole_unassigned = false;
betterShapeHoles[s2Idx].push( ho );
} else {
ambig
i
ous = true;
ambig
u
ous = true;
}
}
}
if ( hole_unassigned ) { betterShapeHoles[sIdx].push( ho ); }
}
}
// console.log("ambig
ious: ", ambigi
ous);
// console.log("ambig
uous: ", ambigu
ous);
if ( toChange.length > 0 ) {
// console.log("to change: ", toChange);
if (! ambig
i
ous) newShapeHoles = betterShapeHoles;
if (! ambig
u
ous) newShapeHoles = betterShapeHoles;
}
}
...
...
@@ -28538,7 +28560,7 @@ THREE.Shape.Utils = {
triangulateShape: function ( contour, holes ) {
function point_in_segment_2D_colin( inSegPt1, inSegPt2, inOtherPt ) {
// inOtherPt needs to be colinear to the inSegment
// inOtherPt needs to be col
l
inear to the inSegment
if ( inSegPt1.x !== inSegPt2.x ) {
if ( inSegPt1.x < inSegPt2.x ) {
return ( ( inSegPt1.x <= inOtherPt.x ) && ( inOtherPt.x <= inSegPt2.x ) );
...
...
@@ -28600,13 +28622,13 @@ THREE.Shape.Utils = {
return [ { x: inSeg1Pt1.x + factorSeg1 * seg1dx,
y: inSeg1Pt1.y + factorSeg1 * seg1dy } ];
} else { // parallel or colinear
} else { // parallel or col
l
inear
if ( ( perpSeg1 !== 0 ) ||
( seg2dy * seg1seg2dx !== seg2dx * seg1seg2dy ) ) return [];
// they are collinear or degenerate
var seg1Pt = ( (seg1dx === 0) && (seg1dy === 0) ); // segment1 is
t
just a point?
var seg2Pt = ( (seg2dx === 0) && (seg2dy === 0) ); // segment2 is
t
just a point?
var seg1Pt = ( (seg1dx === 0) && (seg1dy === 0) ); // segment1 is just a point?
var seg2Pt = ( (seg2dx === 0) && (seg2dy === 0) ); // segment2 is just a point?
// both segments are points
if ( seg1Pt && seg2Pt ) {
if ( (inSeg1Pt1.x !== inSeg2Pt1.x) ||
...
...
@@ -31050,7 +31072,7 @@ THREE.EdgesGeometry.prototype.constructor = THREE.EdgesGeometry;
* parameters = {
*
* curveSegments: <int>, // number of points on the curves
* steps: <int>, // number of points for z-side extrusions / used for subdividing seg
e
ments of extrude spline too
* steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
* amount: <int>, // Depth to extrude the shape
*
* bevelEnabled: <bool>, // turn on bevel
...
...
@@ -31158,7 +31180,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
}
// Variables init
alization
// Variables init
ialization
var ahole, h, hl; // looping of holes
var scope = this;
...
...
@@ -31231,7 +31253,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
var EPSILON = 0.0000000001;
// computes for inPt the corresponding point inPt' on a new contour
// shifte
t
by 1 unit (length of normalized vector) to the left
// shifte
d
by 1 unit (length of normalized vector) to the left
// if we walk along contour clockwise, this new contour is outside the old one
//
// inPt' is the intersection of the two lines parallel to the two
...
...
@@ -31247,10 +31269,10 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
var v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y );
// check for colinear edges
var colinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );
// check for col
l
inear edges
var col
l
inear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );
if ( Math.abs( col
inear0 ) > EPSILON ) { // not co
linear
if ( Math.abs( col
linear0 ) > EPSILON ) { // not col
linear
// length of vectors for normalizing
...
...
@@ -31285,7 +31307,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
shrink_by = Math.sqrt( v_trans_lensq / 2 );
}
} else { // handle special case of colinear edges
} else { // handle special case of col
l
inear edges
var direction_eq = false; // assumes: opposite
if ( v_prev_x > EPSILON ) {
...
...
@@ -32714,7 +32736,7 @@ THREE.TubeGeometry = function ( path, segments, radius, radialSegments, closed,
}
// consruct the grid
// cons
t
ruct the grid
for ( i = 0; i < numpoints; i ++ ) {
...
...
@@ -32860,7 +32882,7 @@ THREE.TubeGeometry.FrenetFrames = function ( path, segments, closed ) {
*/
function initialNormal3() {
// select an initial normal vector perpenicular to the first tangent vector,
// select an initial normal vector perpen
d
icular to the first tangent vector,
// and in the direction of the smallest tangent xyz component
normals[ 0 ] = new THREE.Vector3();
...
...
@@ -34162,7 +34184,7 @@ THREE.DirectionalLightHelper.prototype.update = function () {
* @author WestLangley / http://github.com/WestLangley
* @param object THREE.Mesh whose geometry will be used
* @param hex line color
* @param thresholdAngle the minim
i
m angle (in degrees),
* @param thresholdAngle the minim
u
m angle (in degrees),
* between the face normals of adjacent faces,
* that is required to render an edge. A value of 10 means
* an edge is only rendered if the angle is at least 10 degrees.
...
...
build/three.min.js
浏览文件 @
3d5da598
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录