提交 a9cc8bce 编写于 作者: A alteredq

Applied manually fixes from @broady to 'dev' branch.

https://github.com/mrdoob/three.js/pull/689
上级 c9290555
此差异已折叠。
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
......@@ -73,7 +73,7 @@ THREE.Spline = function ( points ) {
this.getLength = function ( nSubDivisions ) {
var i, index, nSamples,
var i, index, nSamples, position,
point = 0, intPoint = 0, oldIntPoint = 0,
oldPosition = new THREE.Vector3(),
tmpVec = new THREE.Vector3(),
......@@ -126,7 +126,7 @@ THREE.Spline = function ( points ) {
var i, j,
index, indexCurrent, indexNext,
linearDistance, realDistance,
sampling,
sampling, position,
newpoints = [],
tmpVec = new THREE.Vector3(),
sl = this.getLength();
......
......@@ -233,8 +233,8 @@ THREE.PathControls = function ( object, domElement ) {
var lineGeo = createSplineGeometry( spline, 10 ),
particleGeo = createSplineGeometry( spline, 10 ),
lineMat = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 3 } );
lineObj = new THREE.Line( lineGeo, lineMat );
lineMat = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 3 } ),
lineObj = new THREE.Line( lineGeo, lineMat ),
particleObj = new THREE.ParticleSystem( particleGeo, new THREE.ParticleBasicMaterial( { color: 0xffaa00, size: 3 } ) );
lineObj.scale.set( 1, 1, 1 );
......@@ -247,7 +247,7 @@ THREE.PathControls = function ( object, domElement ) {
geo = new THREE.SphereGeometry( 1, 16, 8 ),
mat = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
for ( i = 0; i < spline.points.length; i++ ) {
for ( var i = 0; i < spline.points.length; i ++ ) {
waypoint = new THREE.Mesh( geo, mat );
waypoint.position.copy( spline.points[ i ] );
......
......@@ -11,7 +11,7 @@
* THREE.CubicBezierCurve
* THREE.SplineCurve
* THREE.ArcCurve
*
*
* -- 3d classes --
* THREE.LineCurve3
* THREE.QuadraticBezierCurve3
......@@ -160,7 +160,7 @@ THREE.Curve.prototype.getUtoTmapping = function ( u, distance ) {
// i--;
// console.log('o' , i, Date.now()- time);
time = Date.now();
var time = Date.now();
// binary search for the index with largest value smaller than target u distance
......@@ -629,7 +629,7 @@ THREE.LineCurve3 = THREE.Curve.create(
var r = new THREE.Vector3();
r.sub( v2, v1 ); // diff
r.sub( this.v2, this.v1 ); // diff
r.multiplyScalar( t );
r.addSelf( this.v1 );
......@@ -711,7 +711,7 @@ THREE.SplineCurve3 = THREE.Curve.create(
function ( points /* array of Vector3 */) {
this.points = points;
},
function ( t ) {
......
......@@ -245,7 +245,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) {
}
anglec = ( anglea + angleb ) / 2;
var anglec = ( anglea + angleb ) / 2;
//console.log('angle1', anglea * RAD_TO_DEGREES,'angle2', angleb * RAD_TO_DEGREES, 'anglec', anglec *RAD_TO_DEGREES);
......@@ -684,7 +684,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) {
new THREE.UV( ax / ux, ay / uy ),
new THREE.UV( bx / ux, by / uy ),
new THREE.UV( cx / ux, cy / uy ),
new THREE.UV( cx / ux, cy / uy )
] );
}
......@@ -710,4 +710,4 @@ THREE.ExtrudeGeometry.__v2 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v3 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v4 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v5 = new THREE.Vector2();
THREE.ExtrudeGeometry.__v6 = new THREE.Vector2();
\ No newline at end of file
THREE.ExtrudeGeometry.__v6 = new THREE.Vector2();
......@@ -126,7 +126,7 @@ THREE.TextGeometry.prototype.constructor = THREE.TextGeometry;
// Complete manner
var textPath = new TextPath( text, options );
var textPath = new THREE.TextPath( text, options );
var textShapes = textPath.toShapes();
var text3d = new ExtrudeGeometry( textShapes, options );
......@@ -158,7 +158,7 @@ THREE.FontUtils = {
getTextShapes: function( text, options ) {
var textPath = new TextPath( text, options );
var textPath = new THREE.TextPath( text, options );
var textShapes = textPath.toShapes();
return textShapes;
......@@ -235,12 +235,12 @@ THREE.FontUtils = {
var pts = [];
var i, i2,
var i, i2, divisions,
outline, action, length,
scaleX, scaleY,
x, y, cpx, cpy, cpx0, cpy0, cpx1, cpy1, cpx2, cpy2,
laste,
glyph = face.glyphs[ c ] || face.glyphs[ ctxt.options.fallbackCharacter ];
glyph = face.glyphs[ c ] || face.glyphs[ '?' ];
if ( !glyph ) return;
......@@ -300,7 +300,7 @@ THREE.FontUtils = {
cpx0 = laste.x;
cpy0 = laste.y;
for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2++ ) {
for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2 ++ ) {
var t = i2 / divisions;
var tx = THREE.Shape.Utils.b2( t, cpx0, cpx1, cpx );
......@@ -333,7 +333,7 @@ THREE.FontUtils = {
cpx0 = laste.x;
cpy0 = laste.y;
for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2++ ) {
for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2 ++ ) {
var t = i2 / divisions;
var tx = THREE.Shape.Utils.b3( t, cpx0, cpx1, cpx2, cpx );
......
......@@ -301,8 +301,8 @@ THREE.ColladaLoader = function () {
geometry.skinWeights = [];
geometry.skinIndices = [];
createBones( geometry.bones, skin, hierarchy, skeleton, null, -1 );
createWeights( skin, geometry.bones, geometry.skinIndices, geometry.skinWeights );
//createBones( geometry.bones, skin, hierarchy, skeleton, null, -1 );
//createWeights( skin, geometry.bones, geometry.skinIndices, geometry.skinWeights );
/*
geometry.animation = {
......@@ -515,7 +515,7 @@ THREE.ColladaLoader = function () {
var skinned = false;
var skinController;
var morphController;
var i;
var i, j;
// FIXME: controllers
......@@ -764,15 +764,15 @@ THREE.ColladaLoader = function () {
var minT = 10000000;
for ( i = 0; i < node.channels.length; i ++ ) {
for ( var i = 0; i < node.channels.length; i ++ ) {
var sampler = node.channels[i].sampler;
for (var j = 0; j < sampler.input.length - 1; j ++ ) {
var t0 = sampler.input[j];
var t1 = sampler.input[j+1];
minT = Math.min(minT, t1 - t0);
var t0 = sampler.input[ j ];
var t1 = sampler.input[ j + 1 ];
minT = Math.min( minT, t1 - t0 );
}
}
......@@ -1845,7 +1845,7 @@ THREE.ColladaLoader = function () {
for ( i = 0; i < this.primitives.length; i ++ ) {
primitive = this.primitives[ i ];
var primitive = this.primitives[ i ];
primitive.setVertices( this.vertices );
this.handlePrimitive( primitive, this.geometry3js, vertex_store );
......@@ -1864,6 +1864,7 @@ THREE.ColladaLoader = function () {
var i = 0, j, k, p = primitive.p, inputs = primitive.inputs;
var input, index, idx32;
var source, numParams;
var vcIndex = 0, vcount = 3;
var texture_sets = [];
......@@ -1954,7 +1955,7 @@ THREE.ColladaLoader = function () {
face = new THREE.Face4( vs[0], vs[1], vs[2], vs[3], [ ns[0], ns[1], ns[2], ns[3] ], cs.length ? cs : new THREE.Color() );
}
face.daeMaterial = primitive.material;
geom.faces.push( face );
......@@ -2090,8 +2091,8 @@ THREE.ColladaLoader = function () {
if ( element.childNodes[i].nodeName == 'input' ) {
input = (new Input()).parse(element.childNodes[i]);
this.input[input.semantic] = input;
var input = ( new Input() ).parse( element.childNodes[ i ] );
this.input[ input.semantic ] = input;
}
......
......@@ -27,7 +27,7 @@ THREE.SceneLoader.prototype = {
worker.onmessage = function( event ) {
var dg, dm, dd, dl, dc, df, dt,
g, o, m, l, p, c, t, f, tt, pp,
g, o, m, l, d, p, r, q, s, c, t, f, tt, pp,
geometry, material, camera, fog,
texture, images,
materials, light,
......@@ -118,6 +118,8 @@ THREE.SceneLoader.prototype = {
function handle_objects() {
var object;
for( dd in data.objects ) {
if ( !result.objects[ dd ] ) {
......
......@@ -505,7 +505,7 @@ THREE.MarchingCubes = function ( resolution, materials ) {
this.addPlaneZ = function( strength, subtract ) {
var x, y, z, zz, val, zdiv, cz, cyz;
var x, y, z, zz, val, zdiv, cz, cyz,
// cache attribute lookups
size = this.size,
......@@ -603,7 +603,7 @@ THREE.MarchingCubes = function ( resolution, materials ) {
var geo_callback = function( object ) {
var i, x, y, z, vertex, position, normal,
face, a, b, c, na, nb, nc;
face, a, b, c, na, nb, nc, nfaces;
for ( i = 0; i < object.count; i++ ) {
......
......@@ -32,7 +32,7 @@ if ( THREE.WebGLRenderer ) {
var _camera = new THREE.PerspectiveCamera( 53, 1, 1, 10000 );
_camera.position.z = 2;
_material = new THREE.ShaderMaterial( {
var _material = new THREE.ShaderMaterial( {
uniforms: {
......
......@@ -32,7 +32,7 @@ if ( THREE.WebGLRenderer ) {
var _camera = new THREE.PerspectiveCamera( 53, 1, 1, 10000 );
_camera.position.z = 2;
_material = new THREE.ShaderMaterial( {
var _material = new THREE.ShaderMaterial( {
uniforms: {
......
......@@ -131,8 +131,8 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld = function ( force ) {
// flatten bone matrices to array
var b, bl = this.bones.length;
ba = this.bones;
var b, bl = this.bones.length,
ba = this.bones,
bm = this.boneMatrices;
for ( b = 0; b < bl; b ++ ) {
......
......@@ -2436,7 +2436,8 @@ THREE.WebGLRenderer = function ( parameters ) {
function setLineBuffers ( geometry, hint ) {
var v, c, vertex, offset,
var v, c, vertex, offset, color,
vertices = geometry.vertices,
colors = geometry.colors,
vl = vertices.length,
......@@ -2449,6 +2450,7 @@ THREE.WebGLRenderer = function ( parameters ) {
dirtyColors = geometry.__dirtyColors,
customAttributes = geometry.__webglCustomAttributesList,
i, il,
a, ca, cal, value,
customAttribute;
......@@ -2588,7 +2590,8 @@ THREE.WebGLRenderer = function ( parameters ) {
function setRibbonBuffers ( geometry, hint ) {
var v, c, vertex, offset,
var v, c, vertex, offset, color,
vertices = geometry.vertices,
colors = geometry.colors,
vl = vertices.length,
......@@ -2642,7 +2645,8 @@ THREE.WebGLRenderer = function ( parameters ) {
function setParticleBuffers ( geometry, hint, object ) {
var v, c, vertex, offset,
var v, c, vertex, offset, index, color,
vertices = geometry.vertices,
vl = vertices.length,
......@@ -4022,6 +4026,7 @@ THREE.WebGLRenderer = function ( parameters ) {
shadowMap, shadowMatrix,
oil,
material,
program, buffer,
o, ol, webglObject, object,
lights = scene.lights,
fog = null;
......
......@@ -546,7 +546,7 @@ THREE.ShaderChunk = {
"gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;",
"#endif",
"#endif"
].join("\n"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册