Skip to content

Commit

Permalink
Updated builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jan 23, 2019
1 parent 073a411 commit 61bbcb5
Show file tree
Hide file tree
Showing 3 changed files with 260 additions and 190 deletions.
67 changes: 51 additions & 16 deletions build/three.js
Original file line number Diff line number Diff line change
Expand Up @@ -12026,6 +12026,33 @@

toNonIndexed: function () {

function convertBufferAttribute( attribute, indices ) {

var array = attribute.array;
var itemSize = attribute.itemSize;

var array2 = new array.constructor( indices.length * itemSize );

var index = 0, index2 = 0;

for ( var i = 0, l = indices.length; i < l; i ++ ) {

index = indices[ i ] * itemSize;

for ( var j = 0; j < itemSize; j ++ ) {

array2[ index2 ++ ] = array[ index ++ ];

}

}

return new BufferAttribute( array2, itemSize );

}

//

if ( this.index === null ) {

console.warn( 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.' );
Expand All @@ -12038,33 +12065,43 @@
var indices = this.index.array;
var attributes = this.attributes;

// attributes

for ( var name in attributes ) {

var attribute = attributes[ name ];

var array = attribute.array;
var itemSize = attribute.itemSize;
var newAttribute = convertBufferAttribute( attribute, indices );

var array2 = new array.constructor( indices.length * itemSize );
geometry2.addAttribute( name, newAttribute );

var index = 0, index2 = 0;
}

for ( var i = 0, l = indices.length; i < l; i ++ ) {
// morph attributes

index = indices[ i ] * itemSize;
var morphAttributes = this.morphAttributes;

for ( var j = 0; j < itemSize; j ++ ) {
for ( name in morphAttributes ) {

array2[ index2 ++ ] = array[ index ++ ];
var morphArray = [];
var morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes

}
for ( var i = 0, il = morphAttribute.length; i < il; i ++ ) {

var attribute = morphAttribute[ i ];

var newAttribute = convertBufferAttribute( attribute, indices );

morphArray.push( newAttribute );

}

geometry2.addAttribute( name, new BufferAttribute( array2, itemSize ) );
geometry2.morphAttributes[ name ] = morphArray;

}

// groups

var groups = this.groups;

for ( var i = 0, l = groups.length; i < l; i ++ ) {
Expand Down Expand Up @@ -18687,12 +18724,10 @@

if ( lights.length === 0 ) return;

// TODO Clean up (needed in case of contextlost)
var _gl = _renderer.context;
var _state = _renderer.state;

// Set GL state for depth map.
_state.disable( 3042 );
_state.setBlending( NoBlending );
_state.buffers.color.setClear( 1, 1, 1, 1 );
_state.buffers.depth.setTest( true );
_state.setScissorTest( false );
Expand Down Expand Up @@ -44660,7 +44695,7 @@
geometry2.addAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );
geometry2.computeBoundingSphere();

this.add( new Mesh( geometry2, new MeshBasicMaterial( { side: THREE.BackSide, fog: false } ) ) );
this.add( new Mesh( geometry2, new MeshBasicMaterial( { side: BackSide, fog: false } ) ) );

this.update();

Expand Down Expand Up @@ -45552,8 +45587,8 @@

Object3D.call( this );

if ( dir === undefined ) dir = new THREE.Vector3( 0, 0, 1 );
if ( origin === undefined ) origin = new THREE.Vector3( 0, 0, 0 );
if ( dir === undefined ) dir = new Vector3( 0, 0, 1 );
if ( origin === undefined ) origin = new Vector3( 0, 0, 0 );
if ( length === undefined ) length = 1;
if ( color === undefined ) color = 0xffff00;
if ( headLength === undefined ) headLength = 0.2 * length;
Expand Down
Loading

0 comments on commit 61bbcb5

Please sign in to comment.