|
@@ -19,6 +19,8 @@ function Points( geometry, material ) {
|
|
this.geometry = geometry !== undefined ? geometry : new BufferGeometry();
|
|
this.geometry = geometry !== undefined ? geometry : new BufferGeometry();
|
|
this.material = material !== undefined ? material : new PointsMaterial( { color: Math.random() * 0xffffff } );
|
|
this.material = material !== undefined ? material : new PointsMaterial( { color: Math.random() * 0xffffff } );
|
|
|
|
|
|
|
|
+ this.updateMorphTargets();
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
@@ -136,6 +138,38 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
}() ),
|
|
}() ),
|
|
|
|
|
|
|
|
+ updateMorphTargets: function () {
|
|
|
|
+
|
|
|
|
+ var geometry = this.geometry;
|
|
|
|
+ var m, ml, name;
|
|
|
|
+
|
|
|
|
+ var morphAttributes = geometry.morphAttributes;
|
|
|
|
+ var keys = Object.keys( morphAttributes );
|
|
|
|
+
|
|
|
|
+ if ( keys.length > 0 ) {
|
|
|
|
+
|
|
|
|
+ var morphAttribute = morphAttributes[ keys[ 0 ] ];
|
|
|
|
+
|
|
|
|
+ if ( morphAttribute !== undefined ) {
|
|
|
|
+
|
|
|
|
+ this.morphTargetInfluences = [];
|
|
|
|
+ this.morphTargetDictionary = {};
|
|
|
|
+
|
|
|
|
+ for ( m = 0, ml = morphAttribute.length; m < ml; m ++ ) {
|
|
|
|
+
|
|
|
|
+ name = morphAttribute[ m ].name || String( m );
|
|
|
|
+
|
|
|
|
+ this.morphTargetInfluences.push( 0 );
|
|
|
|
+ this.morphTargetDictionary[ name ] = m;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
clone: function () {
|
|
clone: function () {
|
|
|
|
|
|
return new this.constructor( this.geometry, this.material ).copy( this );
|
|
return new this.constructor( this.geometry, this.material ).copy( this );
|
|
@@ -144,5 +178,4 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
} );
|
|
} );
|
|
|
|
|
|
-
|
|
|
|
export { Points };
|
|
export { Points };
|